010-002-004
Distinction by Parameter Count: Add Method
Medium
Problem Description
Overloading by Parameter Count
Define methods with same name but different parameter counts. Use like add(a, b) and add(a, b, c).
.Test Cases
※ Output examples follow programming industry standards
Input:
10 20 30
Expected Output:
A + B = 30 A + B + C = 60
Input:
5 5 5
Expected Output:
A + B = 10 A + B + C = 15
Input:
0 0 0
Expected Output:
A + B = 0 A + B + C = 0
❌ Some tests failed
Your Solution
Current Mode:● My Code
99
1
2
3
4
5
6
7
8
9
10
›
⌄
⌄
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here
sc.close();
}
}
0 B / 5 MB
You have 9 free executions remaining
