namespace ConsoleApplication2
{
class A
{
public virtual void Amethod( )
{
Console.Write( "A method" );
}
}
class Program : A
{
public override void Amethod( )
{
Console.WriteLine( "B method" );
}
public void Bmethod()
{
Console.WriteLine("C method");
}
static void Main( string[ ] args )
{
A objA = new Program();
//Program objA = new Program( );
objA.Amethod( );
}
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment