what are adding methodsa subclass isnt restricted


What are adding methods?

A subclass isn't restricted to changing the behavior of its superclass. It can also add fully latest techniques and fields that are not shared along with the superclass. For example if a class represents a user of a multi-user database, the user class might begins off along with no access. Secretaries could be given read-only access. Thus the secretary class would have additional techniques to read data that aren't part of the user class.

Data entry clerks might be permitted to read the database and to create latest records but not to modify old records. Thus the data entry class would inherit from the secretary class and have methods to permitting adding new records. A supervisor class would inherit from the data entry class and also have methods in which permit modification of existing records. At last a database manager would inherit from supervisor, other than have new techniques that permitted database managers to change the structure of the database.

As a practical example, recall that the Car class added a numberDoors field and a getNumberOfDoors() method in which the MotorVehicle class didn't have.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: what are adding methodsa subclass isnt restricted
Reference No:- TGS0284730

Expected delivery within 24 Hours