zoukankan      html  css  js  c++  java
  • C#abstract 抽象类

     [访问修饰符] abstract class 类名
           {
      //拥有了普通类出构造函数外的任何东西
      //还可以有抽象函数
           }

    View Code
     1 using System;
     2 public class StudyAbstract 
     3 {
     4     public static void Main()
     5     {
     6         God g = new  YeSu();
     7         g.sing();
     8     }
     9 }
    10 public abstract class God
    11 {
    12     //抽象方法的定义
    13     public abstract void sing();
    14 
    15     
    16 }
    17 //必须实现重写抽象类中的所有的抽象方法
    18 public class YeSu:God
    19 {
    20     public override void sing()
    21     {
    22         Console.WriteLine("哈利路亚");    
    23     }
    24 }
  • 相关阅读:
    python
    python
    python
    python
    python
    python
    python
    python
    人生苦短,我用python,为什么选择python,python简介
    Mysql-查询
  • 原文地址:https://www.cnblogs.com/QLJ1314/p/2622900.html
Copyright © 2011-2022 走看看