014-008-003

Object Class Inheritance: toString() Method

Easy

Problem Description

Object Class Inheritance: toString() Method

Learning Objective: Understand all classes inherit from Object and override toString()

Override Object class toString() method to customize string representation of object.

Input

Line 1: Name
Line 2: Age

Output

[Name: name, Age: age]
```java

## Example

Input:
```java
Taro
25
```java
Output:
```java
[Name: Taro, Age: 25]

Test Cases

※ Output examples follow programming industry standards

Input:
Taro
25
Expected Output:
[Name: Taro, Age: 25]
Input:
Alice
30
Expected Output:
[Name: Alice, Age: 30]
❌ 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