Computer Science, asked by aarushihiya, 7 months ago

Write a program to add and subtract number using function overloading in java

Answers

Answered by unicorn276
2

Answer:

Explanation:

Method overloading rules in Java

void add(int a, int b); // There are two parameters a and b with data type int. ...

void sum(int a, int b); // Two parameters a and b with data type int. ...

void sub(int a, double b); void sub(double a, float a); ...

Output: Sum of two numbers: 30 Sum of three numbers: 350

Similar questions