Question
(JAVA) Write in a class called Car that contains three instance variables that represents the make, model, and year of the car. Define the Car
(JAVA) Write in a class called Car that contains three instance variables that represents the make, model, and year of the car. Define the Car constructor with parameters to initialize these instance variables. Include getter and setter methods for all instance variables, and a toString method that returns a one-line description of the car. Add a method called isAntique that returns a Boolean indicating if the car is an antique (if it is more than 45 years old). Create a driver class called CarTestDrive, whose main method initiates several Car objects and then print whether each of them is an antique.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started