Skip to content

Commit c5df1f2

Browse files
authored
Create AbstrctClassExaple.cs
1 parent b434f8c commit c5df1f2

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

AbstrctClassExaple.cs

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using System;
2+
3+
namespace AbstractClassExample
4+
{
5+
public abstract class GeeksForGeeks
6+
{
7+
public abstract void Gfg();
8+
}
9+
10+
public class Geek1 : GeeksForGeeks
11+
{
12+
13+
public override void Gfg()
14+
{
15+
Console.WriteLine("Class Geek 1");
16+
}
17+
}
18+
19+
public class Geek2 : GeeksForGeeks
20+
{
21+
public override void Gfg()
22+
{
23+
Console.WriteLine("Class Geek 2");
24+
}
25+
}
26+
27+
public static class Program
28+
{
29+
private static void Main(string[] args)
30+
{
31+
GeeksForGeeks g;
32+
g = new Geek1();
33+
g.Gfg();
34+
35+
g = new Geek2();
36+
g.Gfg();
37+
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)