Trace the O/p for a program on inheritance and Polymorphism.

3 classes A,B,C

A with two methods

public virtual SomeMethodA

public virtual SomemoreMethodA

B:A
overide virtual SomeMethodA

C:B
new Method SomeMethodA

override SomeMoreMethodA

main method
{
b new instance of B
b.SomeMethodA
b.SomeMoreMethodA

b1 new instance of C
b1.SomeMethodA
b1.SomeMoreMethodA
}



Trace the O/p for a program on inheritance and Polymorphism. 3 classes A,B,C A with two method..

Answer / payal

call B's SomeMethodA
Call A's SomeMoreMethodA
call C's SomeMethodA
call C's SomeMoreMethodA

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Sharp Interview Questions

why do we use Overloading, Overriding, Boxing, Unboxing, and what is the use of these ?

3 Answers   eXensys,


What are the examples of data types?

0 Answers  


What is the use of xmlserializer?

0 Answers  


What are abstract classes in c#?

0 Answers  


Enlist all the components of an ado.net framework?

0 Answers  






What is dictionary and hashtable in c#?

0 Answers  


Where is c# compiler located?

0 Answers  


What is a string c#?

0 Answers  


What do u mean by thread safe?

0 Answers  


What is a copy constructor in c#?

0 Answers  


How can I use .NET components from COM programs?

0 Answers   DELL,


what is partial assembly reference

0 Answers  


Categories