One of the way through which Java supports polymorphism is overloading. It can be defined as creating two or more methods in the same class sharing a common name but different number of parameters or different types of parameters. You should remember that overloading doesn’t depend upon the return type of the method. Since method binding is resolved at compile-time based on the number of parameters or type of parameters, overloading is also called as compile-time polymorphism or static binding or early binding. Why overloading? In Java, overloading provides the ability to define two or more methods with the
The post How constructor overloading is performed in java appeared first on Coding Security.
How constructor overloading is performed in java
read more
Tidak ada komentar:
Posting Komentar