当前位置:网站首页>C # graphic tutorial (Fourth Edition) chapter7-7.6.1 virtual and override
C # graphic tutorial (Fourth Edition) chapter7-7.6.1 virtual and override
2022-06-12 23:41:00 【Python's path to becoming a God】
using System;
namespace Chapter76_1_VirtualAndOverride
{
class MyBaseClass
{
virtual public void Print()
{
Console.WriteLine("This is the base class,With Virtual ");
}
}
class MyDerivedClass : MyBaseClass
{
override public void Print()
{
Console.WriteLine("This is the derived class.With Override ");
}
}
class Program
{
static void Main(string[] args)
{
//Console.WriteLine("Hello World!");
MyDerivedClass derived = new MyDerivedClass();
MyBaseClass mybc = (MyBaseClass)derived;
derived.Print();
mybc.Print();
}
}
}
边栏推荐
- MySQL row to column, column to row, multiple columns to one row, one row to multiple columns
- Matters of parent-child class construction method in inheritance
- Deep feature synthesis and genetic feature generation, comparison of two automatic feature generation strategies
- The Milvus graphical management tool Attu is coming!
- Gb28181 protocol -- alarm
- Common message oriented middleware selection
- For product managers, which of the two certificates, PMP and NPDP, is more authoritative?
- 自动获取结构体内部成员变量的位置偏移
- About three-tier architecture and MVC
- How does idea switch the interface to Chinese
猜你喜欢

CST learning: four element array design of circular patch antenna (II) array formation and combination results

度量学习(Metric Learning)【AMSoftmax、Arcface】

Colab tutorial (super detailed version) and colab pro/colab pro+ usage evaluation

2022 R2 mobile pressure vessel filling test questions and online simulation test

How to package a colorpicker component for color selection?

Introduction to message oriented middleware (message queue)

So, what is the difference between e.target and e.currenttarget?

2022年G3锅炉水处理考题模拟考试平台操作

Zhengzhou University of light industry -- development and sharing of harmonyos pet health system
![[kubernetes guide ④] pod quick start](/img/ed/e016d2469ee29a387238dc3b5ebbd6.png)
[kubernetes guide ④] pod quick start
随机推荐
2022起重机械指挥上岗证题目模拟考试平台操作
Summary of the lowest level error types in PHP
Restrictions on MySQL function creation
[leetcode] understanding and usage of map[key]+
LeetCode 890 查找和替换模式[map] HERODING的LeetCode之路
测试平台系列(97) 完善执行case部分
自动获取结构体内部成员变量的位置偏移
lua 日期时间
Modify the text color of the menu on the right of toobar
CV—BaseLine总结(从AlexNet到SENet的发展历程)
Gradient accumulation in pytorch [during the experiment, due to the limitation of GPU video memory, the batch\u size can no longer be increased. To solve this problem, the gradient accumulation method
人脸检测:MTCNN
Shardingsphere-proxy-5.0.0 deployment table implementation (I)
2022 heavyweight: growth law - skillfully use digital marketing to break through enterprise difficulties
cookie
Colab教程(超级详细版)及Colab Pro/Colab Pro+使用评测
So, what is the difference between e.target and e.currenttarget?
[North Asia data recovery] data recovery cases in which the partitions disappear and the partitions are inaccessible after the server reinstalls the system
[redis sentinel] failed listening on port 26379 (TCP) & sentinel mode no response problem solved
Summary of MySQL foundation view