package dealership;public abstract class Vehicle { private float dealerPrice; private int year; public Vehicle(float d, int y) { dealerPrice = d; year = y; }
public float getDealerPrice() { return dealerPrice; } public int getYear() { return year; }
public abstract float getStickerPrice();
}
In the space below write a concrete class Carin the dealership package that is a subclass ofVehicle class given above.
You will make two constructors, both of which must callthe superclass constructor. Make a two argumentconstructor (float, int) thatinitializes both instance variables using the arguments (thinkcarefully about how this should be done). Make a single argumentconstructor (float) that initializes thedealerPrice with the float argument andinitializes year to the current year (2020).Override the getStickerPrice()method so that itreturns 1.5 times the dealerPrice if the year isat least 2010, and returns 1.2 times thedealerPrice if the year is older than 2010 (thatis, year < 2010).