zoukankan      html  css  js  c++  java
  • 接口1

    /*
     * 由SharpDevelop创建。
     * 用户: jinweijie
     * 日期: 2015/10/28
     * 时间: 15:25
     * 
     * 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
     */
    using System;

    namespace Interface
    {
        interface IStorable
        {
            void Read();
            void Write();
            int Status{get;set;}
        }
        public class Document:IStorable
        {
            
            int status;
            
            public virtual void  Read()
            {
                Console.WriteLine("Read data from database");
            }
            
            public void Write()
            {
                Console.WriteLine("Write data into database");
            }
            
            public int Status {
                get {
                    return status;
                }
                set {
                    status = value;
                }
            }
        }
        class Note:Document
        {
            public new void Write()
            {
                Console.WriteLine("Write for Note");
            }
            public override void Read()
            {
                Console.WriteLine("Read for Note...");
            }
        }
        
        class Program
        {
            public static void Main(string[] args)
            {
                Console.WriteLine("Hello World!");
                
                // TODO: Implement Functionality Here
                IStorable doc = new Note();
                doc.Status = 10;
                doc.Write();
                doc.Read();
                Note nt = doc as Note;
                if(nt != null)
                {
                    nt.Write();
                }
                
                
                Console.Write("Press any key to continue . . . ");
                Console.ReadKey(true);
            }
        }
    }

  • 相关阅读:
    AX7 VM can not starting
    AX3空Invoice明细问题
    Solution to “VirtualBox can't operate in VMX root mode” error in Windows 7
    Inventory of the materials to teach you how to query a date certain combination of dimensions
    How to Debug Enterprise Portal Code in Dynamics AX 2009
    Axapta 3 COM Connector
    AX 与Citrix打印机问题
    AX ERP 真正的自动批处理
    SQL语句转摘
    D365: Table, Form, Class to extension
  • 原文地址:https://www.cnblogs.com/jinweijie0527/p/4917801.html
Copyright © 2011-2022 走看看