Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Understandiing Virtual, Override, New Keyword in C#
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { A obj = new C(); obj.Display(); //((A)obj).Display(); //Your code goes here Console.WriteLine("Hello, world!"); } } public class A { public virtual void Display() { Console.WriteLine("Class A Call"); } } public class B:A { public new virtual void Display() { Console.WriteLine("Class B Call"); } } public class C : B { public override void Display() { Console.WriteLine("Class C Call"); } } }
run
|
edit
|
history
|
help
0
mendozaeject
dlritytio
c++online
15
Some Fibonacci
Command design pattern
Passing Multidimensional Arrays As Arguments
Пример применения необязательных аргументов
operator
multi variable random number generator