Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java8 programming, inheritance, object-oriented programming , please explain in detail, and also create a test program let it give the expected output 3. (10 points)

Java8 programming, inheritance, object-oriented programming , please explain in detail, and also create a test program let it give the expected output

image text in transcribed

3. (10 points) Free Response: Consider the following class: public class Vehicle { private String plate; private String owner; public Vehicle(String plate, String owner) { this.plate = plate; this.owner = owner; public String toString() { return "Plate #" + this.plate + " owned by " + this.owner; Write a new class, Truck, that is-a Vehicle. Your Truck class must function as follows: Vehicle firstVehicle = new Truck ("121", "Sheikh Kabeer", 7, 2020); System.out.println(firstVehicle); // Prints: Truck with Plate #121 owned by Sheikh Kabeer expires on 7/2020 Vehicle second Vehicle = new Truck ("634876", "John Smith", 10, 2022); System.out.println(secondVehicle); // Prints: Truck with Plate #634876 owned by John Smith expires on 10/2022 Note: Your solution must properly apply the principals of inheritance. Writing a Truck class that does not properly inherit from Vehicle and make use of Vehicle's methods and data will not receive points

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions

Question

How could any of these verbal elements be made stronger?

Answered: 1 week ago

Question

Does your message use pretentious or exaggerated language?

Answered: 1 week ago