What is "Polymorphism" and what are Polymorphism in VB.Net?
Answer Posted / rupali
Polymorphism is ability for redefining methods for derived
classesin OOPs.
its of two types:
1.Compiletime : Method overloading
Methods with same name but diff signatures.
Example:
Public class Calculation
public overloads sub Add(x as integer,y as integer)
return x+y
End Sub
Public overloads sub Add(x along,y as long, z as long)
return x+y+z
End sub
End class
2.Runtime :Method Overriding
Two or more methods with same name,same signatures but with
different implementations.
Example:
Public class DrwingObject
Public Overridable function Draw() as String
return "i am in generic object"
End functin
End class
Public class Line inherits DrawingObject
Public overrides functin Draw() as string
return " i am line"
End Function
End class
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
List the different types of assembly?
difference between control and component more than one differences
When do you use virutal keyword?
how to deploy vb.net with key and evaluation time? any one can help me?
What are all the parts of .net framework?
What is the feature anonymous type?
How to create a constant in vb.net?
How to run a dos command in vb.net?
Explain global assembly cache (gac)?
what is the advantage of option strict on?
Can we use Vb.Net and C# language simultaneously in one .Net application?
What are the features present in vb 2005?
What is visual basic.net culture?
What is private assembly?
what is common language specification?