answersLogoWhite

0

Inheritance is the Java object oriented feature wherein functionality in one class is inherited or available for use in another class. It can be compared to parent-child relationships.

1. Single Inheritance

A Scenario where one class is inheriting/extending the behavior of just one super class.

Ex: public class Ferrari extends Car {…}

2. Multilevel Inheritance

A Scenario where one class is inheriting/extending the bahavior of another class which in turn is inheriting behavior from yet another class.

Ex: public class Automobile {…}

Public class Car extends Automobile {…}

Public class Ferrari extends Car {…}

This multilevel inheritance actually has no limitations on the number of levels it can go. So as far as java goes, it is limitless. But for maintenance and ease of use sakes it is better to keep the inheritance levels to a single digit number.

3. Multiple Inheritance

Actually, java does not support multiple inheritance. You can achieve partial multiple inheritance using interfaces but java is not like C or C++ where you can do direct multiple inheritance. However, you can achieve partial multiple inheritance with the help of interfaces.

Ex: public class FerrariF12011 extends Ferrari implements Car, Automobile {…}

And this is under the assumption that Car and Automobile are interfaces.

Here if you see, though you don't inherit concrete code from the Car or the Automobile interface, you do inherit skeleton methods that determine the way your class eventually behaves and hence this can be considered partial Multiple Inheritance.

User Avatar

Wiki User

14y ago

What else can I help you with?

Continue Learning about Biology

How does the mode of inheritance affect the prediction and analysis of inheritance patterns?

The mode of inheritance (e.g., autosomal dominant, autosomal recessive) determines the likelihood of passing on a genetic trait to offspring and influences the probability of inheritance in a family. Understanding the mode of inheritance is crucial in predicting the risk of inheriting a specific trait or disorder, as well as in genetic counseling and family planning. Inheritance patterns can be more easily analyzed and predicted when the mode of inheritance is known, aiding in the identification and management of genetic conditions within families.


Does the inheritance of one trait effect the inheritance of another trait?

The inheritance of one trait does not directly affect the inheritance of another trait, as different traits are usually controlled by different genes. However, traits located on the same chromosome may be inherited together due to genetic linkage.


What is the type of inheritance that would suggest the concept of blending?

Blending inheritance suggests a type of inheritance where the traits of the parents are mixed together in the offspring, resulting in an intermediate phenotype. This concept contrasts with the idea of particulate or Mendelian inheritance, where discrete units (alleles) are passed from parents to offspring without blending.


What is the least prevalent mode of inheritance?

Polygenic inheritance is the least prevalent mode of inheritance because it involves multiple genes contributing to a single trait and is influenced by environmental factors, making it more complex and less common than other simpler modes like Mendelian inheritance.


What is the difference between cytosplasmic and mendelian inheritance?

To make this simple cytoplasmic inheritance is the inheritance of genes in organelles such as mitochondria that do not go through regular mitosis which is Mendelian inheritance. It is a bit more complex than this and can be easily Googled.

Related Questions

What was we the people modeled after?

It was modeled after the Iroquois treaty.


What is a inheritance?

In Software design, inheritance means a design methodology which includes deriving one class such that it acquires properties of another class. This terminology is modeled after real-life inheritance.In real life, inheritance refers to the passing of ownership of assets from a deceased person to a living person. For example, your father might have stated in his testament that the family home goes to the eldest son, while the collection of classic cars goes to the youngest son. The house thus is the first-born son's inheritance, the classic car collection the second son's inheritance.


What geometric figures are modeled by the stars?

Points are modeled by stars.


The Statue of Liberty's face was said to be modeled after the sculptors what?

The statue of liberty was modeled after Athena


A real word sutuation that can be modeled?

Fraction is a word that can be modeled. This is used mostly in math.


What is the name of the cartoon character modeled after Clara bow?

Betty Boop was modeled after Clara Bow .


Which Native American Nation was the Articles of Confederation modeled after?

The Articles of Confederation was modeled after the Iroquois league.


What actors and actresses appeared in Modeled - 2011?

The cast of Modeled - 2011 includes: Don Bapst


The Founding Fathers modeled the US Congress on what governing body?

It was modeled after "British Parliament".


Who was excella gionne modeled after?

The character Excella Gionne, in Resident Evil 5, was modeled after Nina Fehren.


What is object aggregation?

Acquiring attributes and services through an inheritance relationship with other objects, some objects are aggregation of other objects. The classes representing these objects may be modeled using an aggregation model in below drawing. In this example it has modeled potential library item which is the materials for particular class given in a university. This does not consist of a single item but includes lecture notes, assignments, sample solutions, copies of transparencies used in lectures, videotapes and so on.Adding a block spot to a link means that the relationship between objects is a part of relationship rather than an inheritance relationship.-: An aggregate object representing a course:-


How can ecological competition be modeled?

Competition also can be modeled by examining resources rather than population growth equations.