Header Ads

Abstract class program in c#

Abstract_class_c#
using System;
class Hello
{
public abstract class Talk
{
public abstract void speak();
}
public class SayHello : Talk
{
public override void speak()
{
Console.WriteLine("Hello!");
}
}

static void Main()
{
SayHello hello = new SayHello();
hello.speak();
}
}

Powered by Blogger.