002-001-007
Scanner Class Basics: Hobby Survey
Easy
Problem Description
Scanner Class Basics: Hobby Survey
Learning Objective: Understand Scanner class creation and nextLine() method usage
In a hobby survey program, input and display your favorite hobby. Using Scanner, you can receive data from users during program execution.
Input
Line 1: Hobby (string)
Output
================================
Hobby Survey
================================
What a wonderful hobby!
Your hobby: [hobby]
================================
```java
## Examples
### Example 1: Reading
Input:
```java
Reading
```java
Output:
```java
================================
Hobby Survey
================================
What a wonderful hobby!
Your hobby: Reading
================================
Test Cases
※ Output examples follow programming industry standards
Input:
Reading
Expected Output:
================================
Hobby Survey
================================
What a nice hobby!
Your hobby: Reading
================================Input:
Playing Guitar
Expected Output:
================================
Hobby Survey
================================
What a nice hobby!
Your hobby: Playing Guitar
================================Input:
絵
Expected Output:
================================ Hobby Survey ================================ What a nice hobby! Your hobby: Picture ================================
❌ Some tests failed
Your Solution
Current Mode:● My Code
99
1
2
3
4
5
6
7
8
9
10
›
⌄
⌄
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 6 free executions remaining
