当前位置:网站首页>C abstract class
C abstract class
2022-04-23 03:22:00 【C # primary advanced】

// Case study
Case study
abstract class Father
{
public void Eat()
{
Console.WriteLine(" having dinner ");
}
// Method statement ( Abstract method )
// If there are abstract methods in a class , This class must be abstract
// Abstract methods default to virtual methods
public abstract void Sleep();
}
class Son1: Father
{
public override void Sleep()
{
Console.WriteLine(" Molar sleep ");
}
}
static void Main(string[] args)
{
Father f = new Son1();// polymorphic
f.Sleep();
//Father f = new Father();
}
class Son2:Father
{
public override void Sleep()
{
Console.WriteLine(" Snore and sleep ");
}
}
版权声明
本文为[C # primary advanced]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220621093813.html
边栏推荐
- MySql分组查询规则
- Detailed description of MySQL index [B + tree index, hash index, full-text index, overlay index]
- JSON related
- 幂等性实践操作,基于业务讲解幂等性
- Log4net is in Net core usage
- Why is bi so important to enterprises?
- The most easy to understand service container and scope of dependency injection
- [untitled]
- WinForm allows the form form to switch between the front and active states
- Improvement of ref and struct in C 11
猜你喜欢

Charles uses three ways to modify requests and responses

The most easy to understand service container and scope of dependency injection

超好用的Excel异步导出功能

JS inheritance

Chapter 9 of C language programming (fifth edition of Tan Haoqiang) analysis and answer of exercises for users to establish their own data types

Supersocket is Used in net5 - command

Is it difficult to choose binary version control tools? After reading this article, you will find the answer

可以接收多種數據類型參數——可變參數
![General test technology [II] test method](/img/b7/f661f446616ad6bfbbf48eb03ea82d.png)
General test technology [II] test method

2022山东省安全员C证上岗证题库及在线模拟考试
随机推荐
Test experience data
AWS from entry to actual combat: creating accounts
Batch download of files ---- compressed and then downloaded
Supersocket is Use in net5 - concept
LoadRunner - performance testing tool
Experiment 6 input / output stream
Why is bi so important to enterprises?
js递归树结构计算每个节点的叶子节点的数量并且输出
There is no index in the database table. When inserting data, SQL statements are used to prevent repeated addition (Reprint)
MySQL installation pit
2022t elevator repair test simulation 100 questions and online simulation test
Comprehensive calculation of employee information
EasyUI's combobox implements three-level query
数据库表中不建索引,在插入数据时,通过sql语句防止重复添加(转载)
Can you answer the questions that cannot be answered with a monthly salary of 10k-20k?
Cefsharp stores cookies and reads cookies
MySQL grouping query rules
Mysql database design specification
IOTOS物联中台对接海康安防平台(iSecure Center)门禁系统
Advanced sorting - fast sorting