Write a program to add and subtract number using function overloading in java
Answers
Answered by
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
Science,
4 months ago
Math,
4 months ago
Psychology,
9 months ago
Chemistry,
9 months ago
Biology,
1 year ago
Computer Science,
1 year ago