It's Java; the code should be the same as the output samplebelow; please, thank you.
Note: create a single-file solution that has multipleclass definitions. Also, note that the static main() method shouldbe a member of the Vehicle class.
Create a class called Vehicle that has the manufacturers name(type String), number of cylinders in the engine (type int), andowner (type Person given next). Then, create a class called Truckthat is derived from Vehicle and has the following additionalproperties: the load capacity in tons (type double since it maycontain a fractional part) and towing capacity in pounds (typeint). Be sure your class has a reasonable complement ofconstructors, accessor and mutator methods, and suitably definedequals and toString methods. Write a program to test all yourmethods (see sample run).
The definition of the class Person follows. Completing thedefinitions of the methods is part of this programmingproject.
class Person{
private String name;
public Person()
{...}
public Person(String theName)
{...}
public Person(Person theObject)
{...}
public String getName()
{...}
public void setName(String theName)
{...}
public String toString()
{...}
public boolean equals(Object other)
{...}
}
Output sample: interactive session
Enter·manufacturar·name:Chevrolet↵ Enter·number·of·cylinders:8↵Enter·owner·name:David↵ Enter·load:2800.0↵Enter·towing·capacity:1000↵Enter·1·to·change·vehicle·properties,·2·to·print·and·10·to·quit:2↵main↵Manufacturer:·Chevrolet·Cylinders:·8·Name:·David·Load·Capacity:·2800.0·lbs·Tow·Capacity:·1000·pounds↵Enter·1·to·change·vehicle·properties,·2·to·print·and·10·to·quit:1↵Enter·1·to·change·manufacturar,·2·to·change·cylinders,·3·to·change·owner,·4·to·change·load,·5·to·change·towing·capacity,·or·any·other·number·to·go·back·to·main·menu:4↵Enter·load:50000↵Enter·1·to·change·vehicle·properties,·2·to·print·and·10·to·quit:1↵Enter·1·to·change·manufacturar,·2·to·change·cylinders,·3·to·change·owner,·4·to·change·load,·5·to·change·towing·capacity,·or·any·other·number·to·go·back·to·main·menu:5↵Enter·towing·capacity:1000↵Enter·1·to·change·vehicle·properties,·2·to·print·and·10·to·quit:2↵main↵Manufacturer:·Chevrolet·Cylinders:·8·Name:·David·Load·Capacity:·50000.0·lbs·Tow·Capacity:·1000·pounds↵Enter·1·to·change·vehicle·properties,·2·to·print·and·10·to·quit:10↵↵