Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with this in Java. 1. Create 2 java files and name them: Car.java & CarTest.java Design and implement a class called Car.java
I need help with this in Java.
1. Create 2 java files and name them: Car.java & CarTest.java Design and implement a class called Car.java that: a. Contains Instance data that represents the make, model, and year of the car. (3 attributes) b. Define the Car constructor to initialize these values. C. Include getter and setter methods for all the instance data d. Include a toString method that returns a one-line description of the car. Create a driver class called Car Test.java, whose main method instantiates and updates several Car objects. a. Add the following lines: Car cl = new Car ("Ford", "Taurus", 2007); System.out.println (c1); cl.setModel ("Explorer"); System.out.println (cl); b. Create another 3 objects c2, c3 and c4. And print them out. C. Change the model and year of c2 and print the new object values out. d. Change the make and model of c3 and print the new object values out. e. Change the year of c4 and print the new object value outStep 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