public class A : Object
{
public void writeA()
{
Console.WriteLine("This class A");
}
}
public class B : A
{
public void writeB()
{
Console.WriteLine("This class B");
}
}
class Program
{
static void Main(string[] args)
{
A objA = new A();
objA.writeA();
Console.ReadKey();
B objB = new B();
objB.writeA();
objB.writeB();
Console.ReadKey();
A objAB = new B();
objAB.writeA();
Console.ReadKey();
// Following Code will give (Build)error.
//B objBA = new A();
//objBA.writeA();
//objBA.writeB();
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment