016-003-002
Employee Inheritance with Manager
Easy
Problem Description
In this problem, you will create a program that implements an Employee base class with a name field and introduce() method, then extends it with a Manager class that adds a department field using super() for constructor chaining, and displays the result to standard output.
Create an Employee base class with name field and introduce() method. Then create a Manager class that extends Employee and adds a department field, using super() to call the parent constructor.
Test Cases
※ Output examples follow programming industry standards
Normal case
Input:
new Employee("Tanaka"); emp.introduce()Expected Output:
=== Employee === I am Tanaka === Manager === I am Suzuki Department: Sales
Normal case
Input:
new Manager("Suzuki", "Sales"); mgr.introduce()Expected Output:
=== Employee === I am Tanaka === Manager === I am Suzuki Department: Sales
Your Solution
Current Mode:● My Code
Employee.java🔒
Manager.java🔒
Main.java🔒
3/6 ファイル73B
⚠️警告
- No main method found
9
1
2
›
⌄
class Employee {
}
0 B / 5 MB
You have 10 free executions remaining
