Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Overriding call parent & child class
//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 Pclass { public virtual void Method1(string name) { Console.WriteLine("Parent Class virtual Method1 "+ name); } } public class Cclass: Pclass { public void Met(string name) { Console.WriteLine("Child Class Met "+ name); } public override void Method1(string name) { Console.WriteLine("Parent Child Class Override Method1 "+ name); } } public class Program { public static void Main(string[] args) { //Your code goes here Console.WriteLine("Hello, world!"); Pclass pc=new Pclass(); Cclass cc=new Cclass(); Pclass pcr=cc; cc.Method1("chinna"); pc.Method1("nalla"); pcr.Method1("....hi"); } } }
run
|
edit
|
history
|
help
0
Vídeo01 - Classes e Métodos
123
time
ConvertDataTableToHTML
z
TestCodec1
rangeofset
Project Euler Problem 10
datetime
іфи