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 class method?

480


How do you mark a method obsolete?

592


How can we make a thread sleep for infinite period ?

555


What are the Types of configuration files and their differences

558


What is the difference between an application domain and a process?

486






Can you have more than one namespace in c#?

501


Can we inherit two classes in c#?

519


What are most desktop applications written in?

492


Why is lazy loading?

504


Explain circular reference in c#?

556


What is the difference between int and int in c#?

502


What is data dictionary in c#?

498


If you define a user defined data type by using the struct keyword, is it a value type or reference type?

524


How much time will it take to learn unity?

485


What is the difference between firstordefault and first?

484