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 / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is delegate in c#?

542


What do you understand by 'access specifiers' in C#?

524


What does out mean in c#?

504


What is a delegate in c#?

508


What are strings in c#?

492






What are the properties in c#?

488


What is datetime parse in c#?

517


What is an assembly in .net?

572


How to generate strong name key file or which command is used to generated strong name key file?

512


Why should you override the tostring() method?

590


In gridview in editmode if we want to display information in one combobox based on

1819


Is c# substring zero based?

503


Write a program in c# to find the angle between the hours and minutes in a clock?

485


What's the difference between the debug class and trace class? Documentation looks the same.

504


How can you prevent escaping on backslashes in C# with string definitions?

697