Question: You are to develop a Java class named Car with specified attributes and functionalities. You will also implement an extra method to enhance the class
You are to develop a Java class named Car with specified attributes and functionalities. You will also implement an extra method to enhance the class functionality. The code must be clear, maintainable, and welldocumented code using Java programming best practices. All methods must perform as specified with no errors.
Here are the class requirements:
AttributesData fields all private:
model
ownerName
yearMade
carNumber
Methods:
Constructor to initialize model, ownerName and yearMade.
Constructor to initialize model, ownerName, yearMade and carNumber.
Getter methods for each attribute.
Setter method for carNumber.
carDetails method to return the car details.
compareCarNumber Car otherCarmethod to compare the car number with another car and display a message indicating whether their values are the same or different.
New Method: Create a nongetter and nosetter method of your choice that enhances the functionality of the Car class. You may include additional attribute to support this new method. Avoid providing a method that is overly simplistic.
Provide clear comments in your program.
Provide a rationale for the new method explaining how it contributes to the functionality of the class words
Finally, develop an application that uses your Car class to demonstrate its functionality. You are not allowed to use ArrayList in your program.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
