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


Please Help Members By Posting Answers For Below Questions

How to store images in sql server database through vb.net?

586


Explain how the .net framework performs automatic memory management.

638


What is meant by jagged arrays?

652


write a program to develop a graphic user interface application of marks book with students names and their names.the program should show the following options main menu,add student details,display student details,maximum mark and minimum mark.

1256


Which properties are used to bind a DataGridView control?

657






Explain the use of option explicit?

664


Explain private assembly?

594


What is portable executable?

672


What is the use of console application?

654


Define serialization in .net?

714


Explain nested classes?

628


Did vb6 support multi-threading ?

615


What are the parts of the visual basic control?

612


What is the class that allows an element to be accessed using unique key?

625


thak you Mr Govind for replying to my question. My next question is that how to retrieve image stored in an SQL server table and assign it to any image control or picture control using VB.net

1787