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
Non-User input - Random Controlled - Guessing Game
count number of words in string
pass-len-to-predicate-modified
Quicksort
HDEFDCSA SS0546254
Importent Gen_Coverent Example-1
BFS DFS stack vs recursive
hacktonxx
D11
pared 1