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 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 / kanan
Vibz answer is correct at some level. but i am thinking
different way.
Call to class B's SomeMethodA
Call to class A's SomeMoreMethodA
Call to class C's SomeMethodA <-- our answers differ here
Call to class C's SomeMoreMethodA
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
How will you get the different language strings?
Why do we need private constructor in c#?
What is the difference between properties and indexer in c#?
What is console read in c#?
What are immutable types in c#?
What is short in c#?
What is the difference between class and namespace?
Is xamarin free?
What is the difference between malloc () and new?
how to compare numbers and dispaly the largest ? *first thing I wanted to do is to input how many numbers to be compared *and then analyzed the largest then display it.
Are c# tuples immutable?
Why do you need boxing in c#?
What is the difference between const and static read-only?
What happens when thread sleep () method is called?
What is the difference between finally and finalize block?