Java
Write a class that represents a car.Each car has a year, and a current mileage reading. Include anappropriate constructor, getYear() and getMileage() methods, atoString() method, and anupdateMileage() method that increases the mileage.You only need to provide one constructor, and that constructor musthave two parameters that are used to initialize both data fields.The toString() method must return a string thatcontains the year and mileage in a readable fashion. TheupdateMileage() method should have one parameter,which is the amount to increase the mileage. You arenot expected to write amain method to use/test the class, just create theclass itself.
public class Car
OR
OR