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
English,
3 months ago
English,
3 months ago
Math,
3 months ago
Psychology,
7 months ago
Chemistry,
7 months ago
Math,
11 months ago
Biology,
11 months ago
Computer Science,
11 months ago