Method overloading

Constructor overloading

Do you know what is the meaning of method overloading?

Do you know what is the meaning of constructor overloading?

Let me explain. Hii I'm Kalimullah Ansari and I'm am going to explain meaning of constructor overloading and method overloading in Java.

Java supports constructor overloading as well as method overloading.

In method overloading we create more than one method with same name but different parameters in a class.eg.

Create a class with name blog1 and create a method name greet

Class blog1{

{

Static void greet();

Static void greet (int a, int b);

Static void greet (float a,float b);

}

In same way we can define the constructor overloading. In constructor overloading name of a method as same as class name and consists of different parameters.

Constructor overloading does not return any value.

Ex

Class blog1

{

Void blog1();

Void blog1 (int a, int b);

Void blog1 (int a, float b);

}

}