017-005-002
Class and Interface Relationship: Multiple Interface Implementation
Medium
Problem Description
class and Interface Relationship: Multiple Interface Implementation
Learning Objective: Implement multiple interfaces in one class
In this problem, you will create a program that implements two interfaces Callable (phone functionality) and MusicPlayer (music player functionality) in a SmartPhone class, and displays the corresponding result based on the input operation (call or play) to standard output.
Create a SmartPhone class that implements both the Callable and MusicPlayer interfaces, and override each method defined in those interfaces.
Input
1 line: Operation (call or play)
Output
For call:
Calling...
```java
For play:
```java
Playing music...
```java
## Example
Input:
```java
call
```java
Output:
```java
Calling...
Test Cases
※ Output examples follow programming industry standards
Normal case
Input:
play
Expected Output:
Playing music...
Normal case
Input:
play
Expected Output:
Playing music...
Your Solution
Current Mode:● My Code
Phone.java🔒
MusicPlayer.java🔒
SmartPhone.java🔒
Main.java🔒
4/6 ファイル232B
⚠️警告
- No main method found
9
1
2
3
4
5
›
⌄
import java.util.Scanner;
interface Phone {
void call();
}
0 B / 5 MB
You have 10 free executions remaining
