Lecture notes

contents


Interfaces

  • Named collection of abstract methods and constant declarations
  • The methods are defined, but not implemented
  • You can convert from a class type to an interface type (if the class implements interface)
BancAccount account = new BankAccount(1000);
Measurable x = account;
  • You cannot convert between unrelated types

Polymorphism

  • Principle that behavior can vary depending on the type of an object
  • In Java, the type of an object determines the method that is called

Key takeaways

  • a

Lecture slides