Lab III
Lab III
Lab III
1. Write a program that car inherits some fields and methods from vehicle class.
2. Write a program that DDU teacher inherits some properties and functionalities from DDU
employees.
3. Create class box and box3d. box3d is extended class of box. The above two classes going
to pull fill following requirement
❖ Include constructor.
❖ set value of length, breadth, height
❖ Find out area and volume.
Note: Base class and sub classes have respective methods and instance variables.
4. Write a program to create a class named shape. In this class we have three sub classes
circle, triangle and square each class has two-member function named draw () and erase ().
Create these using inheritance concepts
5. The super keyword [ differentiate members+ invoke superclass constructor]
➢ Write a java program that a student class inherits different fields and methods
from person class.
➢ Write a java program that computer science department inherits some courses
from different departments.