30
1
using System;
2
3
class Parent
4
{
5
public virtual void Method(int x)
6
{
7
Console.WriteLine("Parent's version of Method");
8
}
9
}
10
11
class Child : Parent
12
{
13
public override void Method(int x)
14
{
15
Console.WriteLine("Child's override version of Method(int)");
16
}
17
public void Method(double y)
18
{
19
Console.WriteLine("Child's version of Method");
20
}
21
}
22
23
public class Program
24
{
25
public static void Main()
26
{
27
Child c = new Child();
28
c.Method(10);
29
}
30
}
Cached Result