007-002-001
Class and Object: Person Info Class
Easy
Problem Description
Class and Object: Person Info Class
Learning Objective: Declare class and create object
Create Person class with name and age, create object and display information. Implement constructor and methods.
Input
Line 1: Name (string)
Line 2: Age (integer)
Output
Name: [name]
Age: [age] years old
```java
## Examples
### Example 1: Taro age 20
Input:
```java
Taro
20
```java
Output:
```java
Name: Taro
Age: 20 years old
```java
### Example 2: Hanako age 25
Input:
```java
Hanako
25
```java
Output:
```java
Name: Hanako
Age: 25 years old
```java
### Example 3: Minimum value (boundary)
Input:
```java
A
0
```java
Output:
```java
Name: A
Age: 0 years old
Test Cases
※ Output examples follow programming industry standards
Input:
Taro 20
Expected Output:
Input:
Hanako 25
Expected Output:
Input:
A 0
Expected Output:
❌ Some tests failed
Your Solution
Current Mode:● My Code
Person.java🔒
Solution.java🔒
2/6 ファイル0B
⚠️警告
- No main method found
9
1
›
0 B / 5 MB
You have 9 free executions remaining
