Java Tutorials

Implements Java Keyword

The implements keyword is used in a class declaration to indicate that the class being declared provides implementations for all methods declared in the interface whose name follows the implements keyword.
  • In the example above, the Truck class must provide implementations for all methods declared in the IVehicle interface.
  • The Truck class is otherwise independent; it may declare additional methods and variables and may extend another class.
  • A single class may implement multiple interfaces.
  • public class Truck implements IVehicle
    {
    }


    No comments:

    Post a Comment