Computer Science, asked by rupasharma, 1 year ago

define the term overloading in java

Answers

Answered by priyanshuranjan1204
3

Overloading in Java is the ability to define more than one method with the same name in a class. The compiler is able to distinguish between the methods because of their method signatures.

Answered by Hacket
1

Overloading in simple terms creating multiple methods with same name but with different parameters. This feature of OOPs allows to group number of methods doing identical work but with different set of parameters / different types of parameters.

Example-

void add(int a, int b);

void add(int a, float b);

void add(int a, int b, int c);

int a=10;

float f=10.56f;

String s=”Ayush";

print(a); print(f);print (s);

Similar questions