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 Posted / 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 View All Answers
Explain about Threading Types.
Is Multiple-inheritance supported by c#?
What is a thread? What is multithreading?
How many destructors can a class have?
Why we use anonymous methods in c#?
What is lazy loading and eager loading in c#?
How can I produce an assembly?
C# called c sharp why?
What is an assembly in .net?
How can you prevent escaping on backslashes in C# with string definitions?
What is remote data?
Is an array an object c#?
What is dto c#?
What is callback delegate in c#?
What is the predicate of a sentence?