GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Microsoft  >  DotNet
Go To First  |  Previous Question  |  Next Question 
 DotNet  |  Question 11 of 165    Print  
How does VB.NET/C# achieve polymorphism?

  
Total Answers and Comments: 4 Last Update: March 23, 2007   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: samiksc
 

VB.Net / C# provide polymorphism through the following mechanisms:

  1. Inheritance -- base class provides overridable methods which are re-implemented in derived classes.
  2. Interface -- different class can implement same interface, resulting in different implementations of interface methods.
  3. Virtual methods -- achieve runtime polymorphism.


Above answer was rated as good by the following members:
RanjeetaRajendran
May 24, 2005 07:59:15   #1  
Vijay        

RE: How does VB.NET/C# achieve polymorphism?
Using abstract classes and functions
 
Is this answer useful? Yes | No
July 31, 2005 14:15:44   #2  
Pijush        

RE: How does VB.NET/C# achieve polymorphism?
Polymorphism is form of several behaviour of a object in object hiararchi. The base classes keeps the mothods abstract which to be implimented by derrived classes to have different behaviour to provide polymor or more form of working !!!
 
Is this answer useful? Yes | No
January 12, 2006 04:47:55   #3  
samiksc Member Since: October 2005   Contribution: 233    

RE: How does VB.NET/C# achieve polymorphism?

VB.Net / C# provide polymorphism through the following mechanisms:

  1. Inheritance -- base class provides overridable methods which are re-implemented in derived classes.
  2. Interface -- different class can implement same interface resulting in different implementations of interface methods.
  3. Virtual methods -- achieve runtime polymorphism.

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
March 23, 2007 17:30:42   #4  
Tresa        

RE: How does VB.NET/C# achieve polymorphism?

VB.Net achieves polymorphism thru
1. Overriding
2. Overloading

Polymorphism refers to an object taking different shapes in its life time . It is linked to inheritance .

Thru overloading the same method works with different parameters

eg : public void area(int parameter1)
{

areavalue parameter1 * parameter1;

}

public void area(int parameter1 int parameter2)
{
areavalue parameter1*parameter2;
}

Overiding : we override the methods in the abstract class. Overriding is the process by which a method in the parent class is replaced by the derived class.

public override void square();



 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape