Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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