Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How to achieve Polymorphism in VB.Net?
How to achieve Polymorphism in VB.Net?
✍: Guest
We can achieve polymarphism in .Net i.e Compile time polymarphism and Runtime polymarphism. Compiletime Polymarphism achieved by method overloading. Runtime polymarphism achieved by Early Binding or Late Binding. Provide the function pointer to the object at compile time called as Early Binding.
provide the function pointer to the object at runtime called as Late Binding
class emp having the method display()
class dept having the method display()
create objects as in the main function
// Early binding
dim obj as new emp
dim ob as new dept
obj.display()-to call the display method of emp class
ob.display-to call the display method of the dept class
// Late binding
create object in the main class as
object obj
obj=new emp
obj.display()-to call the display of emp class
obj=new dept
obj.display()-to call the display of dept class
2013-12-04, 1915👍, 0💬
Popular Posts:
Which bit wise operator is suitable for turning on a particular bit in a number? The bitwise OR oper...
How can I execute a PHP script using command line? Just run the PHP CLI (Command Line Interface) pro...
How To Call a Sub Procedure? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions To...
How do you override a defined macro? You can use the #undef preprocessor directive to undefine (over...
What are shared (VB.NET)/Static(C#) variables? Static/Shared classes are used when a class provides ...