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

Input:
call
Expected Output:
Calling...
Input:
play
Expected Output:
Playing music...
Input:
unknown_action
Expected Output:
Playing music...
Input:
call
Expected Output:
Calling...
❌ Some tests failed
❌ エラー発生

Your Solution

Current Mode: My Code
Phone.java🔒
MusicPlayer.java🔒
SmartPhone.java🔒
Main.java🔒
4/6 ファイル232B
⚠️警告
  • No main method found
import java.util.Scanner;

interface Phone {
void call();
}
0 B / 5 MB

You have 6 free executions remaining