Assignment – 6

GOAL: Understanding Multilevel Inheritance, Abstraction

  1. Create an abstract class called HeadOffice.
  2. Have below normal methods in it. 2.1. public void check_accounts(int amount) – Have a print statement inside here 2.2. public int pay_tax(int amount) – return this.amount from here
  3. Have an abstract method as below. 3.1. public abstract void receive_Customers()
  4. Create another abstract class called Branch_Plan as sub class of HeadOffice
  5. Have main method in it.
  6. Add a print statement inside main method.
  7. Add below method – public void do_interview() – Have a print statement inside here.
  8. Create another class ‘Branch’ as sub class of Branch_Plan
  9. Handle abstract methods here with print statements.
  10. Create an instance called ‘branch’ for Branch class.
  11. Confirm the below methods can be called. – public void check_accounts(1000) – public int pay_tax(2000) – Check if value is returned. – public void do_interview()

HeadOffice.java

Branch_plan.java

Branch.java

Leave a Reply

Create your own website, free on WordPress.com.Create your own website.
Start free