Big Java Late Objects
Big Java Late Objects
2nd Edition
ISBN: 9781119330455
Author: Horstmann
Publisher: WILEY
Question
Book Icon
Chapter 9, Problem 1RE
Program Plan Intro

Subclass:

  • A class which is derived from some other class is called a subclass.
  • The subclass inherits the state and behaviour of its ancestor class.
  • It is also called a child class

Super class:

  • Super class is the class from which a subclass can be derived.
  • Super class allows the subclass to inherit its state and the behaviour.
  • It is also called a parent class.

Expert Solution
Check Mark

Explanation of Solution

a.

Given:

Superclass: “Employee”

Subclass: “Manager”

Reason:

  • The class “Employee” is super class because, every manager is an employee but not the other way around.
  • The “Manager” class is more specialized and will contain only the data of employees whose designation is manager.
  • But the class “Employee” will contain all the properties and behavior of an employee. The employees may have the designation such as manager, salesman, accountant, marketing executive and many more.

Explanation of Solution

b.

Given:

Superclass: “Student”

Subclass: “GraduateStudent”

Reason:

  • The class “Student” is super class because it will contain all the students in a collage.
  • The class “GraduateStudent” is subclass of “Student” because, it will contain only the details of students they are graduating in that year.
  • So, “GraduateStudent” can inherit all the properties and behaviour from the class “Student”.

Explanation of Solution

c.

Given:

Superclass: “Person”

Subclass: “Student”

Reason:

  • The class “Person” is super class because it will the details of a person who can be a child, a student, an employee and so on.
  • The class “Student” is subclass of “Person” because, it stands for a particular set of persons who are studying.
  • So, all the states and properties of a person applicable to every student, and all these properties can be inherited from the super class.

Explanation of Solution

d.

Given:

Superclass: “Employee”

Subclass: “Professor”

Reason:

  • The class “Employee” is super class because, every professor is an employee but not the other way around.
  • The “Professor” class is more specialized and will contain only the data of employees whose designation is a professor.
  • But the class “Employee” will contain all the properties and behavior of an employee. The employees may have the designation such as manager, salesman, professor, accountant, marketing executive and many more.

Explanation of Solution

e.

Given:

Superclass: “BankAccount”

Subclass: “CheckingAccount”

Reason:

  • The class “BankAccount” is more general and it will contain the data of every accounts. This class will contain the properties like account number, name, balance, transaction and methods like deposit (), withdraw () and more.
  • The classes “CheckingAccount” is a type of account and it also contains the properties like account number, name, balance, transaction and methods like deposit (), withdraw ().
  • One can use the properties and methods of “BankAccount” class in the “CheckingAccount” class.

Explanation of Solution

f.

Given:

Superclass: “Vehicle”

Subclass: “Car”

Reason:

  • The class “Vehicle” is more general and represents every type of vehicle such as, Car, Truck, Bus and many more.
  • The class “Car” is more specific and it only represents a vehicle, car. So, the class “Car” can inherit all the properties and behaviours of class “Vehicle”.

Explanation of Solution

g.

Given:

Superclass: “Vehicle”

Subclass: “Minivan”

Reason:

  • The class “Vehicle” is more general and represents every type of vehicle such as, Car, Truck, Bus and many more.
  • The class “Minivan” is more specific and it only represents a vehicle, minivans. So, the class “Minivan” can inherit all the properties and behaviours of class “Vehicle”.

Explanation of Solution

h.

Given:

Superclass: “Car”

Subclass: “Minivan”

Reason:

  • The class “Car” is more general and represents every type of cars such as, Van, Minivan, Pickup, Truck, Roadster and many more.
  • The class “Minivan” is more specific and it only represents a van, minivans. So, the class “Minivan” can inherit all the properties and behaviours of class “Car”.

Explanation of Solution

i.

Given:

Superclass: “Vehicle”

Subclass: “Truck”

Reason:

  • The class “Vehicle” is more general and represents every type of vehicle such as, Car, Truck, Bus and many more.
  • The class “Truck” is more specific and it only represents a vehicle, truck. So, the class “Truck” can inherit all the properties and behaviours of class “Vehicle”.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
What are the major threats of using the internet? How do you use it? How do children use it? How canwe secure it? Provide four references with your answer. Two of the refernces can be from an article and the other two from websites.
Assume that a string of name & surname is saved in S. The alphabetical characters in S can be in lowercase and/or uppercase letters. Name and surname are assumed to be separated by a space character and the string ends with a full stop "." character. Write an assembly language program that will copy the name to NAME in lowercase and the surname to SNAME in uppercase letters. Assume that name and/or surname cannot exceed 20 characters. The program should be general and work with every possible string with name & surname. However, you can consider the data segment definition given below in your program. .DATA S DB 'Mahmoud Obaid." NAME DB 20 DUP(?) SNAME DB 20 DUP(?) Hint: Uppercase characters are ordered between 'A' (41H) and 'Z' (5AH) and lowercase characters are ordered between 'a' (61H) and 'z' (7AH) in the in the ASCII Code table. For lowercase letters, bit 5 (d5) of the ASCII code is 1 where for uppercase letters it is 0. For example, Letter 'h' Binary ASCII 01101000 68H 'H'…
What did you find most interesting or surprising about the scientist Lavoiser?

Chapter 9 Solutions

Big Java Late Objects

Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education