014-003-002
Multiple Arguments Superclass Constructor Call
Easy
Problem Description
Multiple Arguments Superclass constructor Call
In this problem, you will create a program that defines a Vehicle constructor accepting two arguments (maker and year), then implements a Car class that initializes the parent using super(maker, year) while adding its own model field, and reads the car details from standard input to display.
Learning Objective: Initialize parent class by passing multiple arguments to super()
Create an automobile management system. Create a Vehicle class with a multi-parameter constructor, and have the Car class pass multiple arguments using super().
Input
maker (String)
year (int)
model (String)
Output
===== Car Information =====
Maker: <maker>, Year: <year>
Model: <model>
==========================
Sample
Input:
Toyota
2024
Camry
Output:
===== Car Information =====
Maker: Toyota, Year: 2024
Model: Camry
==========================
Test Cases
※ Output examples follow programming industry standards
Normal case
Input:
Nissan 2021 Altima
Expected Output:
===== Car Information ===== Maker: Nissan, Year: 2021 Model: Altima ==========================
Normal case
Input:
Honda 2022 Civic
Expected Output:
===== Car Information ===== Maker: Honda, Year: 2022 Model: Civic ==========================
Your Solution
Current Mode:● My Code
Vehicle.java🔒
Car.java🔒
Solution.java🔒
3/6 ファイル336B
9
1
2
›
⌄
public class Vehicle {
}
0 B / 5 MB
You have 10 free executions remaining
