019-002-004

Exception Classes: Custom Exception

Hard

Problem Description

Custom Exception Classes

Create custom exceptions by extending Exception class. Enables business logic-specific exception handling.

.

Test Cases

※ Output examples follow programming industry standards

Input:
25
Expected Output:
Valid age: 25
Input:
-5
Expected Output:
Error: Invalid age - must be between 0 and 150
Input:
0
Expected Output:
Valid age: 0
❌ Some tests failed
❌ エラー発生

Your Solution

Current Mode: My Code
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