012-002-001
Static Method Usage: Math Utility
Easy
Problem Description
static method Usage: Math Utility
In this problem, you will create a program that implements three static methods (max, min, sum) in a MathUtil class, reads two integers, computes the maximum, minimum, and sum using those static methods, and displays the results to standard output.
Learning Objective: Understand how to call static methods and their benefits
Create a MathUtil class and learn to call methods without instantiation. Static methods can be called directly from the class name (e.g., MathUtil.max(a, b)).
Input
Line 1: Two integers (space separated)
Output
Max: [larger]
Min: [smaller]
Sum: [sum]
Test Cases
※ Output examples follow programming industry standards
Normal case
Input:
10 5
Expected Output:
Max: 10 Min: 5 Sum: 15
Boundary case
Input:
3 3
Expected Output:
Max: 3 Min: 3 Sum: 6
Your Solution
Current Mode:● My Code
MathUtil.java🔒
Solution.java🔒
2/6 ファイル97B
⚠️警告
- No main method found
9
1
2
3
4
›
⌄
import java.util.Scanner;
class MathUtil {
}
0 B / 5 MB
You have 10 free executions remaining
