当前位置:网站首页>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();
}
}
}
边栏推荐
- scala中的隐式转换和隐式参数讲解与实践
- 妙才周刊 - 5
- QT actual combat case (38) -- using qpprocess class to realize the function of starting process
- The fate of Internet people is that it is difficult to live to 30?
- InfoQ 极客传媒 15 周年庆征文|简述构建微服务架构的四大挑战
- Theory + practice will help you master the dynamic programming method
- Insight into China's smart medical industry in 2022
- 最全预告!华为云精彩议程火速收藏
- Leetcode 2200. 找出数组中的所有 K 近邻下标(可以,一次过)
- 2202 - production de CV
猜你喜欢

2022 electrician (elementary) operation certificate examination question bank and online simulation examination

36 krypton's debut | "osogena" won nearly ten million angel rounds of financing. The original DLR scientists of German Aerospace Research and development system modeling and simulation CAE software PA

Theory + practice will help you master the dynamic programming method

2022年危險化學品經營單比特安全管理人員考試試題及在線模擬考試

2202-簡曆制作

Opencv source code compilation

MySQL基础篇视图的总结

The Milvus graphical management tool Attu is coming!
C language: how to give an alias to a global variable?

妙才周刊 - 5
随机推荐
Find out the data that can match the keyword key in field 1 or field 2 in the database table. If you want to display the matching data in field 1 first
Matters of parent-child class construction method in inheritance
2202-简历制作
Design MySQL table structure for message queue to store information data
最全预告!华为云精彩议程火速收藏
MySQL基础篇视图的总结
移动安全必备之CS呢【NETHUNTER】
2022 questions d'examen pour le personnel de gestion de la sécurité de l'unit é de gestion des produits chimiques dangereux et examen de simulation en ligne
Zhengzhou University of light industry -- development and sharing of harmonyos pet health system
How to package a colorpicker component for color selection?
CV - baseline summary (development history from alexnet to senet)
Printf segment error (core dump): a problem caused by formatted output
KConfig
dict和set的基本操作
Don't write about the full screen explosion, try the decorator mode, this is the elegant way!!
Dry goods sharing | BitSet application details
Leetcode 2164. 对奇偶下标分别排序(可以,一次过)
Is the stock account opened by qiniu Gang safe and reliable?
Redis实现短信验证码登录
Bit_ Binary number