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
}
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 |
why do we use Overloading, Overriding, Boxing, Unboxing, and what is the use of these ?
What are the examples of data types?
What is the use of xmlserializer?
What are abstract classes in c#?
Enlist all the components of an ado.net framework?
What is dictionary and hashtable in c#?
Where is c# compiler located?
What is a string c#?
What do u mean by thread safe?
What is a copy constructor in c#?
How can I use .NET components from COM programs?
what is partial assembly reference