java编程思想学习笔记–interfaces

  1. An interface provides only a form, but no implementation.All methods inside an interface are abstract.
  2. An interface can also contian fields, but these are implictly static and final.
  3. All methods inside an interface are automaticlly public. When you implement an interface, the methods from the interface must be defined as public.
  4. Creating a method that behaves differently depending on the argument object that you pass it is called the Strategy design pattern.
  5. In Adapter design pattern, you write code to take the interface that you have and produce the inteface that you need.
  6. extends can refer to multiple base interfaces when building a new interface.
  7. Fields defined in interfaces cannot be “blank finals”, but they can be initialized with non-constant expressions. The fields are not part of the interface. The values are stored in the static storage area for that interface.