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 Posted / 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 |
Post New Answer View All Answers
Can main method be final?
How do I do implement a trace?
How do you prevent a class from being inherited?
What is difference between static and readonly in c#?
What are the 3 types of comments in c#?
Why it's said that writing into .NET Application Configuration Files is a Bad Idea?
How to use nullable types in .net?
What is the difference between C# 3.5 and C# 4.0?
Is c sharp and c# are same?
What do you mean by parsing and how to parse a date time string in c#?
What is session state in asp net c# with example?
How many types of variables are there in c#?
What is the difference between system.string and system.text.stringbuilder classes?
Define Abstract Class in C#
What issues can be faced while delivering code?