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
Name some string escape sequences in c#.
How does dependency injection work c#?
What is static classes in c#?
What is Garbage Collection in .Net?
Define parsing?
What does the keyword “virtual†declare for a method or property?
What is string literal in c#?
Write a short note on interface?
Why do we use threads in c#?
What is the compiler of c#?
Define multicast delegate? How it be used?
If a child class instance is created, which class constructor is called first - base class or child class?
What is the difference between class and namespace?
What are the principles of delegation?
What is for loop in c#?