Interfaces in Java- Key Points

  • In the Java programming language, an interface is a reference type, similar to a class, that can contain only constants, method signatures, and nested types.
  •  Interfaces cannot be instantiated—they can only be implemented by classes or extended by other interfaces.
  • To use an interface, you write a class that implements the interface. When an instantiable class implements an interface, it provides a method body for each of the methods declared in the interface.
  • The Java programming language does not permit multiple inheritance.
  • In Java, a class can inherit from only one class but it can implement more than one interface.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s