Question: 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 out
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
