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 |
What is the difference between out and ref in c#?
Difference between ByVal and ByRef?
What is difference between singleton and static class in c#?
Which are the access modifiers available in c#?
What is the use of ispostback in c#?
What is the difference between list and array in c#?
Is c# strongly typed?
Is null c# operator?
what are the benefits in using c# ?
What is the difference between list and dictionary in c#?
List the fundamental oop concepts?
What are the valid parameter types we can pass in an Indexer ?