a BigTruck class that extends the Truck class. The BigTruck class should have th
ID: 3670197 • Letter: A
Question
a BigTruck class that extends the Truck class. The BigTruck class should have the following members: A field for the load capacity in tons (an int). A constructor and appropriate accessors and mutators. A toString method that overrides the toString method in the base class. The BigTruck class’s toString method should display only the truck’s name and the truck’s load capacity. Demonstrate the classes in a program that has a Truck array. Assign 2 Truck objects and 3 BigTruck objects to the array elements. The program should then step through the array, calling each object’s toString method. The output should display 5 trucks and each truck has the name and its load capacity
Explanation / Answer
Please find the required program below :
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.