Question & Additional Information
 
What is polymorphism?
Add to My IQ
 

 | 
Inappropriate
Answer Title
Answer
Polymorphism is the idea that a base class can be inherited by several classes. A base class pointer can point to its child class and a base class array can store different child class objects.
Question Tag Title
Tags
Question Asked At Title
Asked At
None
Question Job Title
Job Titles


Check out our newest job listings!

Post a Job! $49 for 60 days



Your Name:
Add your comment text
 
Related Questions
Related Questions
Flag this interview question as inappropriate Inappropriate
See Answer
In software engineering the concept of abstraction is extremely important. Microsoft calls its own language abstraction layer the Common Intermediate Language (CIL). Similar to byte code like Java generates IL supports all object oriented features including data abstraction, inheritance, polymorphism, etc. In addition to these features IL supports other concepts such as properties, fields and enumeration. Any .net language can be converted into IL, so .net supports multiple languages and perhaps multiple platforms. CIL is also called as MSIL (Microsoft Intermediate Language). When .net code is compiled it is converted into IL, which is then executed. Because of IL objects created in one language can be accessed and derived from another. E.g. it is possible to create a class in VB.Net and derive from it in C#.
Create Date
:
Saturday, May 10, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
Polymorphism is the ability of objects belonging to different types to respond to method calls of the same name, each one according to an appropriate type-specific behavior. It means that if class B inherits from class A, it doesn't have to inherit everything about class A. That is, it can do some of the things that class A does differently.
Create Date
:
Thursday, April 03, 2008
Tags
:
Asked At
:
None
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
Runtime Polymorphism is method overriding.polymorphism -an entity existing in different forms at the same time. Polymorphism is of two types. Static polymorphism and dynamic polymorphism. Run time polymorphism refers to dynamic polymorphism wherein an entity changes it's form depending on the cirumstances.
Create Date
:
Sunday, March 16, 2008
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer

 

 

Create Date
:
Monday, September 24, 2007
Tags
:
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (2) :
1.
dk123
Wednesday, March 19, 2008 6:27 AM
nice comment
2.
thingMaster
Tuesday, October 23, 2007 1:52 PM
you are overconfident. you will probably kill many patients, but drive a nice car.
Flag this interview question as inappropriate Inappropriate
See Answer
 This is all to do with polymorphism. When a virtual method is called on a reference, the actual type of the object that the reference refers to is used to decide which method implementation to use. When a method of a base class is overridden in a derived class, the version in the derived class is used, even if the calling code didn't "know" that the object was an instance of the derived class. For instance:

public class Base
{
    public virtual void SomeMethod()
    {
    }
}

public class Derived : Base
{
    public override void SomeMethod()
    {
    }
}

...

Base b = new Derived();
b.SomeMethod();

will end up calling Derived.SomeMethod if that overrides Base.SomeMethod. Now, if you use the new keyword instead of override, the method in the derived class doesn't override the method in the base class, it merely hides it. In that case, code like this:

public class Base
{
    public virtual void SomeOtherMethod()
    {
    }
}

public class Derived : Base
{
    public new void SomeOtherMethod()
    {
    }
}

...

Base b = new Derived();
Derived d = new Derived();
b.SomeOtherMethod();
d.SomeOtherMethod();

Will first call Base.SomeOtherMethod (line 3), then Derived.SomeOtherMethod (line 4). They're effectively two entirely separate methods which happen to have the same name, rather than the derived method overriding the base method.

If you don't specify either new or overrides, the resulting output is the same as if you specified new, but you'll also get a compiler warning (as you may not be aware that you're hiding a method in the base class method, or indeed you may have wanted to override it, and merely forgot to include the keyword).

That provides the basics of overriding and the difference between new and override, but you should really see a book or tutorial for a more in-depth look at polymorphism.
Create Date
:
Friday, November 16, 2007
Tags
:
Asked At
:
None
Job Positions
:
None
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
 
• More Related Questions: 
Suggestions & Comments




Share Your Interview Questions
Ask Interview Questions
View Unanswered Questions





Advertise on this site