previous | start | next

Syntax 11.2: Implementing an Interface

 
public class ClassName
   implements InterfaceName, InterfaceName, ...
{
      // methods
      // instance variables
}

Example:

 
public class BankAccount implements Measurable
{
   // Other BankAccount methods
   public double getMeasure()
   {
      // Method implementation
   }
 }

Purpose:

To define a new class that implements the methods of an interface

previous | start | next