Inheritance, implementing inheritance, interface inheritance, JAVA Programming

Assignment Help:

 

Inheritance - is the inclusion of state and behavior of a base class in a derived class so that they are accessible in that derived class. The key benefit of Inheritance is that it gives the formal mechanism for

code reuse. Any shared piece of business logic may be moved from the derived class into the base class as part of refactoring method to improve maintainability of your code by avoiding code duplication. The existing class is called the superclass and the derived class is defined the subclass. Inheritance may also be illustrate as the process whereby one object requires characteristics from one or more other objects the similar way children accepts characteristics from their parents. There are basically two types of inheritances:

 

1. Implementation inheritance: You will extend an application's functionality by reusing functionality in the parent class by extending all or some of the operations already implemented. In Java, you can only add from one superclass. Implementation inheritance promotes reusability but improper use of class inheritance can gives programming nightmares by dividing encapsulation and building future changes a problem. With implementation inheritance, the subclass becomes hardly coupled with the superclass. This will build the design fragile because if you need to change the superclass, you have to know all the details of the subclasses to avoid breaking them. So when using implementation inheritance, make sure that the subclasses relay only on the nature of the superclass, not on the actual implementation.

 

2. Interface inheritance: That is also known as subtyping. Interfaces give a mechanism for specifying a relationship between otherwise unrelated classes, typically by specifying a set of common methods each implementing class must obtain. Interface inheritance provides the design concept of program to interfaces not to implementations. This also reduces implementation dependencies or the coupling between systems. In Java, you will implement any number of interfaces. This is more flexible and reliable than implementation inheritance because it won't restrict you into specific implementations which build subclasses difficult to maintain. So care could be taken not to divide the implementing classes by modifying the interfaces.

 


Related Discussions:- Inheritance, implementing inheritance, interface inheritance

Find representative skyline points in to 2 dimensional data, Find represent...

Find representative skyline points in to two dimensional data Project Description: Run skyline algorithm run representative skyline algorithm up to skyline algorithm (Affi

What is jar archives, What is JAR archives? JAR archives are ZIP archiv...

What is JAR archives? JAR archives are ZIP archives along with a different extension. They contain a hierarchy of files and directories. In spirit a JAR file can take the place

Need android geolocation service app, Need Android GeoLocation Service App ...

Need Android GeoLocation Service App Project Description: I want an android service app that will run on the background. The app has to get the users location (latitude an

Application with two user transactions-java, 1.) Write an application with ...

1.) Write an application with two user transactions (login which includes viewAllStudents and viewStudent ) with full MVC architecture that displays the details of the selected

What is a target , A target is the class that is being advised. The class ...

A target is the class that is being advised. The class can be a third party class or your own class to which you require to add your own custom behavior. By using the concepts of A

When should i use abstract classes and interfaces, When should I use abstra...

When should I use abstract classes and when should I use interfaces?  Use Interface, when: Design changing often or when various implementations only share method sign

What is the role of hub in networks, What is the role of hub in networks? ...

What is the role of hub in networks? The network traffic controller - elements of convential computer networks. Hub is used to link the different computers within the network i

Develop tennis draw software, Project Description: We need to develop so...

Project Description: We need to develop software that has a database of players with the ability to delete and add players at will, once captured there can be a draw to set them

Collaboration diagrams, Collaboration diagrams are also communication diagr...

Collaboration diagrams are also communication diagrams. Collaboration diagrams give the same message as the sequence diagrams. But the collaboration diagrams depend on the object f

State in detail about java virtual machine, State in detail about Java Virt...

State in detail about Java Virtual Machine (JVM) Central part of java platform is java virtual machine Java bytecode executes by special software known as a "virtual machine

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