Explain what is multilevel inheritance, JAVA Programming

Assignment Help:

Explain what is Multilevel Inheritance ?

The Car-Motorcycle-MotorVehicle instances showed single-level inheritance. There's nothing to stop you from going next. You can describe subclasses of cars for compacts, station wagons, sports coupes and more. For instance, this class describes a compact as a car with two doors:

public class Compact extends Car {

// constructors
public Compact(String licensePlate, double maxSpeed,
String make, String model, int year, int numberOfPassengers) {
this(licensePlate, 0.0, maxSpeed, make, model, year, numberOfPassengers);
}

public Compact(String licensePlate, double speed, double maxSpeed,
String make, String model, int year, int numberOfPassengers) {
super(licensePlate, speed, maxSpeed, make, model,
year, numberOfPassengers, 2);
}
}
Compact not only inherits from its immediate superclass, Car, but also from Car's superclass, MotorVehicle. Therefore the Compact class also has a make, a model, a year and so on. There's no limit to this chain of inheritance, by getting more than four or five classes deep creates code excessively complex. 


Related Discussions:- Explain what is multilevel inheritance

I want school management project, I want School Management project Proje...

I want School Management project Project Description: An easy school management project which able to store all data about students like fees structure, admission details and

Important nodes, there are N nodes in a graph, the graph isuni directional ...

there are N nodes in a graph, the graph isuni directional with M edges of these M nodes in a graph, there are K nodes which are important nodes. given initial position I within thi

Packages and interfaces, what are the advantages of packages and interface?...

what are the advantages of packages and interface? why we use them? and what is the way of using packages and interfaces complete description with examples?

Loops, Use a while loop to count down from 100 and display all the numbers ...

Use a while loop to count down from 100 and display all the numbers in the * following pattern (you have to figure out what the pattern is - don''t go below 0): * 100 99 97 94

Want a page to store emails when click as save, Want a page to store emails...

Want a page to store emails when click as save, then pass along to another page with the emails in the URL Project Description: I have a page that populates with listing; the

Develop a camera application, Project Description: I want to build a cam...

Project Description: I want to build a camera application for android. By default android will add metadata for the image, for e.g.  Date, time, resolution, gps tag etc..In this

Debugging, Debugging mode can be enabled by adding the following line of co...

Debugging mode can be enabled by adding the following line of code before creating new connections: XMPPConnection.DEBUG_ENABLED = true; When debugging mode is enabled, a

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd