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
Is hashset ordered c#?
Why do you call it a process? What’s different between process and application in .net, not common computer usage, terminology?
How main method is called in c#?
What is the difference between == and object.equals?
Is an array an object c#?
Is it possible to force garbage collector to run?
What is a string in c#?
Explain about Destructor method?
What is difference between Trace and Debug
What is short in c#?
How do namespaces work?
Is c# a keyword?
What is yield in c#?
Can partial class be inherited?
What is int tryparse in c#?