Search This Blog

22 March, 2011

C# Program with "abstract keyword".


C# Program with "abstract keyword".






abstract class aaa
{
abstract public void sam();
}
/* class bbb:aaa                   // wrong
{
}  */
abstract class ccc:aaa         //Correct
{
}
class ddd:aaa
{
public override void sam()
{
System.Console.WriteLine("Hello");
}
}
class psp
{
public static void Main()
{
//aaa a;                              //Correct
//a=new aaa();               // Wrong , Because can't create instance or object of an abstract class . 
ddd d =new ddd();
d.sam();
}




-------------------------------------------------------------------------





No comments:

Post a Comment

Meetme@