Abstraction in Java Assignment Help

Assignment Help: >> Java Programming Concepts >> Abstraction in Java

Abstraction in Java:

It is in the nature of any class hierarchy that as you move through the classes from the top to the bottom of the hierarchy, the classes that you encounter become more and more specialized versions of the classes that lie above. Or, turning this around - moving from the bottom towards the top of the hierarchy, the classes become more and more general and abstract. At some point in this process, the top-level classes become so general that it may be more useful to consider them as part of the structure of the hierarchy than as classes from which we would want to create objects. This is the motivation for abstract classes.

As an example, consider Figure, which illustrates classes in a database used for a personnel application.

2218_abstraction.png

The top class Employee contains information required for all the employees in an organization: it will, for example, contain instance variables for the name of an employee, their address and their tax details. This class has two more specialized subclasses. The first class, MonthlyEmployee, represents those employees who are paid monthly and who often will receive special payments such as travelling expenses and commissions. The other class, WeeklyEmployee, represents other workers who are paid weekly and whose pay is calculated in a different way from monthly paid employees - for example, they may receive overtime payments.

At the lowest level of the hierarchy is the even more specialized class CarMonthlyEmployee for monthly paid staff who are provided with a car by the company. These would be staff such as sales staff for whom car travel is essential. Inside this class there would be methods and instance variables specific to this variation from its parent class. For example, there would be an instance variable describing the make of car and methods to retrieve and set this variable.

The classes in the hierarchy in Figure 4 represent an increasingly more specialized view of the notion of an employee. The topmost class represents the most general concept of an employee; this contains instance variables and methods common to all employees. As you proceed down the hierarchy, the category of employee becomes more specialized, with additional data or functions, or different ways of carrying out similar functions. It is likely that no real employee will correspond to the Employee class and, in practice, only objects corresponding to the subclasses of Employee will be created. We can take this one step further and define Employee in such a way that Employee objects cannot be created - this is the idea of an abstract class.

 

Java Assignment Help - Java Homework Help

Struggling with java programming language? Are you not finding solution for your Abstraction in Java homework and assignments? Live Abstraction in Java experts are working for students by solving their doubts & questions during their course studies and training program. We at Expertsmind.com offer Abstraction in Java homework help, java assignment help and Abstraction in Java projects help anytime from anywhere for 24x7 hours. Computer science programming assignments help making life easy for students.

Why Expertsmind for assignment help

  1. Higher degree holder and experienced experts network
  2. Punctuality and responsibility of work
  3. Quality solution with 100% plagiarism free answers
  4. Time on Delivery
  5. Privacy of information and details
  6. Excellence in solving java programming language queries in excels and word format.
  7. Best tutoring assistance 24x7 hours

 

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