Interfaces

An interface  is like a totally abstract class.

It specifies placeholder methods only.

A specific class implements  an interface.

 

abstract class Vehicle implements movingObject
  {

 

  }

 

To implement  an interface, a class must define all methods of the interface.

 

Ex

To implement an Enumeration, a class must define:

Object nextElement()
boolean hasMoreElements()

A single class may implement several interfaces.

 

To Next Slide To Previous Slide To Contents