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
What is thread pooling?
How do I automate my desktop application?
What is the difference between system.string and system.text.stringbuilder classes?
What is the difference between static class and singleton class in c#?
What do u mean by thread safe?
Define thread? Explain about multithreading?
if you do have a stack overflow profile.what is your ranking?
Why we use oops in c#?
How do you create partial methods?
Explain lock, monitors, and mutex object in threading.
How to use reflection to call generic method?
What is arraylist?
Is c# code is unmanaged or managed code?
Why dictionary is used in c#?
Is c# scripting language?