Uploaded by Ahmad Soffi

Abstract Class Practice

advertisement
Lab-5: OOP Programming
02/05/2021
Abstract Class
Fattah Alizadeh
The following class diagram shows the class properties of a system which
simulates a collection of various shapes which we coded in the last class:
1
Perform the following tasks:
a) Define the similar class diagram about the abstraction for your own problem
such as:
i. Employee, Admin and Academic Staff
ii. Animal, mammal and birds
iii. Vehicle, taxi, truck
iv.
….
b) Write a program (JAVA) to implement the above class diagram in at least 3
classes and one driver class for testing the methods.
c) Add a variable/ method to count total number of objects of the super class
and one of the sub-classes.
d) In the toString() method of the sub-class, call the toString() method of the
abstract super class.
2
Download