Abstract Classes and Interfaces Exercises

  < Previous  Next >
  1. When is it required to make a class abstract?
  2. Think of 2-3 scenarios when it would be appropriate to use an abstract base class. Share these scenarios with someone else, describing the reasons for having an abstract base class.
  3. Make your SimpleBankAccount class from the Inheritance Exercises abstract. Does the main() method in the AccountsDriver class still compile and run? If it does, explain why. If not, make appropriate changes.
  4. Think of 2-3 scenarios when it would be appropriate to use an interface. Share these scenarios with someone else, describing the reasons for having an interface.
  5. Write a simple Java class that implements an interface.