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
Get step-by-step solutions from verified subject matter experts
