012-002-002
Static Method: Utility Functions
Medium
Problem Description
static method: Utility Functions
In this problem, you will create a program that defines a static method max in the MathUtil class, accepts two integers, returns the larger value, and displays the result to standard output.
Learning Objective
Learn how to define and call static methods.
Problem
Create a static method in MathUtil class to find the maximum of two numbers.
Input
Line 1: First number (integer)
Line 2: Second number (integer)
Output
Max: [maximum].
Test Cases
※ Output examples follow programming industry standards
Normal case
Input:
5 3
Expected Output:
Max: 5
Normal case
Input:
10 20
Expected Output:
Max: 20
Your Solution
Current Mode:● My Code
MathUtil.java🔒
Main.java🔒
2/6 ファイル93B
⚠️警告
- 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
