Java 2 Primer Plus

   

Java™ 2 Primer Plus

By Steven Haines, Steve Potts

Table of Contents
Chapter 8.  Interfaces

Sometimes there is some confusion about when to use interfaces and when to simply create abstract methods and place them in a super class. Here are a few guidelines:

  • Use an abstract base class method when the functionality is tightly coupled with the object itself

  • Use an interface when the functionality is auxiliary to the object

  • Use an interface when the functionality can be applied globally to other unrelated objects


       
    Top
     

    Категории