How does VB.NET/C# achieve polymorphism?

Showing Answers 1 - 9 of 9 Answers

Praveen Kumar

  • Sep 23rd, 2005
 

Using Function Overloading and Function Overriding we can achieve polymorphism in .net

  Was this answer useful?  Yes

prudhviram

  • Sep 13th, 2006
 

I dont think the question dont mean the syntax that you use, but I think what the question all about is how you achieve polymorphism. In polymorphism there are multiple methods having the same signature.1.public int Add(int x, iny)2.public float Add(float x, float y)3. public double Add(double x, double y)

  Was this answer useful?  Yes

Abhishek

  • Sep 27th, 2006
 

Also by Virtual Method.

  Was this answer useful?  Yes

learnasp

  • Oct 24th, 2007
 

Having multiple methods with different signature is not polymorphism. That is function overloading.

Polymorphism allows you to use a particular object as multiple types, that is its own type and the base types. It is achieved through inheritance.  The derived class can have the behaviour of the base class or can define its own behaviour by overriding the virtual functions of the base class.

  Was this answer useful?  Yes

caveman

  • Apr 23rd, 2008
 

>>>
Having multiple methods with different signature is not polymorphism. That is function overloading.
<<<<
I am afraid this is also one form of polymorphism and is called Compile-time polymorphism.


>>>
Polymorphism allows you to use a particular object as multiple types, that is its own type and the base types. It is achieved through inheritance. The derived class can have the behaviour of the base class or can define its own behaviour by overriding the virtual functions of the base class.
<<<<


This is runtime polymorphism

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions