using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication2
{
    //输出的结果是ABAB
    class Program
    {
        static void Main(string[] args)
        {
            a a = new b();
            b b = new b();
           // c c = new a();//这样调是错的

        }
    } 
    public  class a
    {
         public  a()
      {
          Console.WriteLine("a");
          Console.Read();
         }
    }
   public  class b:a
   {

       public b()
       {
           Console.WriteLine("b");
           Console.Read();

       }
    }
    public class c : a
    {
        c()
        {
            Console.WriteLine("c");
        }
    }
}

 

相关文章:

  • 2021-08-03
  • 2021-09-30
  • 2022-12-23
  • 2021-08-14
  • 2022-12-23
  • 2021-06-11
猜你喜欢
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案