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 do I run managed code in a process?
What is private and shared assembly?
What is difference between string and stringbuffer in c#?
Can enum be null c#?
what is collections in .net? why we use?
What are destructors in C#?
From which base class do all Web Forms inherit from?
How does c# generics and c++ templates compare?
Describe two uses of the “using” statement during the operation of c#?
What is unmannaged code and will CLR handle this kind of code or not .
What is private class in c#?
Define MSIL, and how does it works? Why our developers need an appreciation of it if at all?
What is data annotation in c#?
How does c# achieve polymorphism?
What are async and await?