In computer science, polymorphism is a programming language feature that allows values of different data types to be handled using a uniform interface. The concept of parametric polymorphism applies to both data types and functions. A function that can evaluate to or be applied to values of different types is known as a polymorphic function. A data type that can appear to be of a generalized type (e.g., a list with elements of arbitrary type) is designated polymorphic data type like the generalized type from which such specializations are made.








Example of overloading
Public overloads function find data (by val, name as srn as Array list find data and return result end function
Can be overloaded as shown below
Public overloads function find data (by val age as integer)
As array list find data and return result end function
Overloading constructers:
A constructor performs various. Tasks those are not visible to you as the programmer even if you were no code for the constructer. These tasks are all associated with building a complex.
Example
Public overloads sub new ()
Initialize object here
End sub
Public overloads sub new (by Val ID as integer)
Use the ID value to initialize the object
End sub
No comments:
Post a Comment