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 are the advantages of using delegates in c#?
List down the fundamental oop concepts?
Why do you need boxing in c#?
Why c# is type safe?
What are the value types in c#?
How jit (just in time) works?
When should we use sealed class in c#?
What are the string functions in c#?
Can a constructor be private in c#?
Why do we use namespace in c#?
What do you mean by directing?
Can partial class be inherited?
Is namespace necessary in c#?
What is the main method?
How can I access the registry from c# code?