Inheritance
1. Create a class Plants that has child classes of Trees and Shrubs. Create a Sub class of
Trees as Fruit bearing tress. Identify attributes and methods of each class. Instantiate
the fruit bearing tree class and show its attributes. Show the classes in the form of a
tree as well
2. Write a Java program that creates a class hierarchy for employees of a company. The
base class should be Employee, with subclasses Manager, Developer, and
Programmer. Each subclass should have properties such as name, address, salary, and
job title. Implement methods for calculating bonuses, generating performance reports,
and
3. Write a Java program to create a vehicle class hierarchy. The base class should be
Vehicle, with subclasses Truck, Car and Motorcycle. Each subclass should have
properties such as make, model, year, and fuel type. Implement methods for
calculating fuel efficiency, distance traveled, and maximum speed.
4. Write a Java program to create a class hierarchy for university staff.
The base class should be Staff, with subclasses Professor, Administrator, and
Technician. Each subclass should include properties like name, department, salary,
and position. Implement methods for assigning tasks, calculating overtime pay, and
generating weekly schedules.
5. Create a Java program that models a bank account system using inheritance.
Define a base class Account with subclasses SavingsAccount, CheckingAccount, and
FixedDepositAccount. Include properties such as account number, holder name, and
balance. Implement methods for deposit, withdrawal, interest calculation, and
displaying account summaries.