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


Please Help Members By Posting Answers For Below Questions

Why are dynamic link library used over static one?

533


How does dictionary work in c#?

464


Can constructor have return type c#?

628


What are PE(Portable Executable)?

534


What do you mean by generic class in c#?

486






What are the three types of operators?

459


What is the difference between an integer and int?

468


What are constants in c#?

552


write a program to find the biggest palindrome in the given string

534


What do you mean by winforms in c#?

498


What is Satellite Assemblies ?

546


What is IL / CIL / MSIL?

651


Can you use all access modifiers for all types?

533


What is a dynamic assembly?

516


What is c# used for in the industry?

480