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

Write javascript code to convert the number, Write JavaScript code to conve...

Write JavaScript code to convert the number 236.2363611111556 into currency format and JavaScript statement to show output? Var input_amt = 236.2363611111556 ; mid_data = input

A talent agency program , class Writer extends Client {    // additional m...

class Writer extends Client {    // additional members    private boolean technical = false;    private boolean government = false;    private boolean international = false;    pri

I want hall rental website, I want Hall Rental Website Project Descripti...

I want Hall Rental Website Project Description: I want to prepare website for my party venue where i will post the photos and detail of place along with availability calendar

What are the layers of rmi architecture, There are three layers:-  a . S...

There are three layers:-  a . Stub and Skeleton layer This layer lies just under the view of the developer. This layer intercepts method calls made by the client to the inte

Determine the meaning of finalize, Determine the meaning of finalize W...

Determine the meaning of finalize When  a  finalize method  is  defined  in  a  class,  Java  run  time  calls  finalize() whenever  it's  about  to  recycle  an object  of  t

Write html and javascript code for the needs, Write HTML and JavaScript cod...

Write HTML and JavaScript code for the needs shown in the diagram below? When ConvertoUpperCase button is pressed then the entered text is converted to upper case and result is

Describe the edit phase- java program development, Describe the Edit phase-...

Describe the Edit phase- Java Program Development Phase comprises editing a file. This is done with an editor program. Programmer types a java program using editor such as no

How many jsp scripting elements , How many JSP scripting elements and what ...

How many JSP scripting elements and what are they? Ans) Three scripting language elements are there: a)      declarations, b)      scriptlets, c)       expressions.

What is the difference between internet and intranet, What is the differenc...

What is the difference between Internet and Intranet ? Intranet and internet are 2 domains which are extremely a like but frequent segregated in order to manage security. Inter

What is role of action class, An Action Class performs a role of an adapter...

An Action Class performs a role of an adapter among the contents of an incoming HTTP request and the corresponding business logic that should be implemented to process this request

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