当前位置:网站首页>C # learning about abstract classes
C # learning about abstract classes
2022-06-09 20:32:00 【charlsdm】
The following code covers the cases of abstract class learning
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp3
{
abstract class Fruits
{
public string name;
public abstract void Bad();
public virtual void Test()
{
}
}
class Apple : Fruits
{
public override void Bad()
{
Console.WriteLine(" The apple has rotted away ");
}
}
class SuperApple:Apple
{
public override void Bad()
{
Console.WriteLine(" The super apple is rotten ");
}
public override void Test()
{
Console.WriteLine(" Super apple Test");
}
}
class Program
{
static void Main(string[] args)
{
Fruits fruits = new Apple();
fruits.Bad();
Fruits myfruits = new SuperApple();
myfruits.Test();
}
}
}
边栏推荐
- 护网面试(杂)
- SSL (secure socket layer) digital certificate
- C#中的泛型T的应用
- 数据处理基本流程
- 杰理之修改提高摄像头源视频输出帧率【篇】
- The HMI Software memory is abnormal, resulting in a crash exit bug
- C# For循环的一些小细节
- C#中关于Partial的作用
- After 1995, programmers in big factories were sentenced to 9 months for deleting databases
- C language to realize computer automatic shutdown program -- it can be used to spoof roommate's computer
猜你喜欢

Personal blog system (with source code)

Problems and solutions of VFP accessing Oracle under 64 bit win10 environment

杰理之蓝牙配网【篇】

Neo4j desktop database backup

做产品规划的技巧心得

Neo4j桌面版數據庫備份

2022山东健博会,食疗养生与滋补健康展,健康管理与精准医学展

SSL (secure socket layer) digital certificate

目标分割之--Unet对多类别数据集的语义分割

VFP在64位win10环境下访问oracle出现的问题及解决方案
随机推荐
Target Segmentation -- semantic segmentation of multi category dataset by Unet
[operation and maintenance department] ad domain file permission management
【RK2206】4. MQTT示例
Pan micro oa9 foreground unlimited getshell
HMI 串口屏 SD卡/TF卡升级的 bug
VFP在64位win10环境下访问oracle出现的问题及解决方案
Potential functions commonly used in lammps and collection of crystal library resources
卡尔曼滤波(KF)无迹卡尔曼滤波(UKF)
平安证券开户有什么风险吗?安全的吗?
SSL (secure socket layer) digital certificate
FPGA入门实验-基于状态机实现多按键控制变速流水灯和跳变灯
These six ways to implement load balancing technology should not be missed
[tgowt] cmake to Ninja construction
C#中关于Partial的作用
Changshu science and technology applet SQL injection
Lammps中常用的势函数和晶体库资源收集
Apple Announces Winner of the 2022 Apple Design Award
Common regular expressions
C#中MemberwiseClone的用法
Redis knowledge points