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 are cshtml files?
Can you inherit from a static class in c#?
What is verbatim literal in c#?
What is type safe code?
Is c# 8 released?
What is the difference between interface and abstract class ?
If you want to write your own dot net language, what steps you will u take care?
What is Implementation inheritance and interface inheritance?
What is ulong in c#?
Can we have 2 main methods in c#?
What is the main method in c#?
What is the use of private constructor in c#?