Question: In java write a constructor for a new class called CarSale that brings in a vin as text, price as a double, and year as

In java write a constructor for a new class called CarSale that brings in a vin as text, price as a double, and year as an integer as parameters. Have it set variables for the class (you decide the variable names that are there, you dont need to declare them in this answer) with these parameters. Included exception handling and throw an exception if the price is less than 0 or if the year is less than 1970.

You are required to define a constructor of class CarSale, not define the class itself.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!