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
}
Answers were Sorted based on User's Feedback
Answer / vibz
Call to B's SomeMethodA
Call to A's SomeMoreMethodA
Call to B's SomeMethodA
Call to C's SomeMoreMethodA
Is This Answer Correct ? | 7 Yes | 2 No |
Answer / 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 |
What do you mean by jagged arrays in c#?
What is covariance and contravariance? Did Delegate and method overriding support these?
Is c# queue thread safe?
What’s a strong name?
What is array formula?
how to use caching in our program. why we use it give one example in code
How can I create image pieces/sub image?
Does constructor return any value in c#?
What can be done with c#?
Are c# tuples immutable?
Is unity object oriented?
What is array c#?