answersLogoWhite

0


Best Answer

Inheritance in Java refers to the feature wherein the code/functionality of one class can be used in another class that extends this class. Example:

public class Parent {

...

..

}

public class Child extends Parent {

...

..

.

}

Here the class Child extends the class Parent and hence the methods of Parent are available for Child to use. This way we are re-using the code in the parent class in the child class instead of re-writing the whole thing again.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

The main purpose of code reuse in Inheritance is to reduce the usage of memory.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the use of reusability in inheritance?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is advantage of software reusability?

What is advantage of software reusability?


How the three tired architecture provides reusability?

I don't believe so. If they are tired, no use at all, let along re-use.


What is a use inheritance?

Code Re-use is one of the biggest uses of Inheritance


How do OO analysis and design facilitate reusability?

Through the use of interfaces and abstract classes that define common behaviors


Use the word inheritance in a sentence?

She received a large inheritance from her wealthy grandmother.


Features of Autocad?

Reusability,error tracking etc


What is re usability in c plus plus?

Code reusability can be found in every programming language, it is not a feature that is specific to C++. However, object oriented languages such as C++ give us much better opportunities for code reusability through inheritance. That is, a derived class inherits the public and protected members of its base classes, so we can make use of existing code to provide more specialised implementations. We don't have to continually re-invent wheels to implement base class functionality that already exists. Moreover, shared class libraries allow us to re-use code in more than one application.


What supports reusability and extensibility of classes in c plus plus?

There are two ways to reuse a class in C++. Composition and inheritance. With composition, any class data member can be an instance of an existing class. With inheritance, we can derive a new class from an existing class. Either way, we create a new class of object with all the properties of the existing class which can be extended and/or replaced with properties of our own.


What makes the space shuttle different from other rockets?

Reusability.


Where does inheritance take place?

Inheritance, in the context of object-oriented programming, takes place between classes where one class (called the sub-class or child class) inherits attributes and methods from another class (called the super-class or parent class). This allows for code reusability and the establishment of a hierarchical relationship between classes.


How is reusability supported by inheritance in C Plus Plus?

Inheritance is the notion that a derived class inherits all the public and protected members of its base class. In other words, we are re-using the existing code in the base class; we need only add the specific overrides required to provide the more specialised behaviour we require of the derived class. Without inheritance, we'd have to write duplicate code in order to cater for the base class functionality we require in our derivatives, and duplicate code adds to the maintenance burden.


Did Gregor Mendel use animals in his experiments?

Mendel studied plant inheritance.