New Features Added in Interfaces in JDK 9

From Java 9 onwards, interfaces can contain the following also:

  1. Static methods
  2. Private methods
  3. Private Static methods

Interfaces in Java

An Interface in Java programming language is defined as an abstract type used to specify the behavior of a class. An interface in Java is a blueprint of a behavior. A Java interface contains static constants and abstract methods.

Similar Reads

What are Interfaces in Java?

The interface in Java is a mechanism to achieve abstraction. There can be only abstract methods in the Java interface, not the method body. It is used to achieve abstraction and multiple inheritances in Java using Interface. In other words, you can say that interfaces can have abstract methods and variables. It cannot have a method body. Java Interface also represents the IS-A relationship....

Relationship Between Class and Interface

A class can extend another class similar to this an interface can extend another interface. But only a class can extend to another interface, and vice-versa is not allowed....

Difference Between Class and Interface

Although Class and Interface seem the same there have certain differences between Classes and Interface. The major differences between a class and an interface are mentioned below:...

Java Interfaces Examples

Let’s consider the example of vehicles like bicycles, cars, bikes, etc they have common functionalities. So we make an interface and put all these common functionalities. And lets Bicycle, Bike, car, etc implement all these functionalities in their own class in their own way....

Advantages of Interfaces in Java

The advantages of using interfaces in Java are as follows:...

Multiple Inheritance in Java Using Interface

Multiple Inheritance is an OOPs concept that can’t be implemented in Java using classes. But we can use multiple inheritances in Java using Interface. let us check this with an example....

New Features Added in Interfaces in JDK 8

There are certain features added to Interfaces in JDK 8 update mentioned below:...

Extending Interfaces

One interface can inherit another by the use of keyword extends. When a class implements an interface that inherits another interface, it must provide an implementation for all methods required by the interface inheritance chain....

New Features Added in Interfaces in JDK 9

From Java 9 onwards, interfaces can contain the following also:...

Important Points in Java Interfaces

In the article, we learn certain important points about interfaces as mentioned below:...

Must Read

Access Specifier of Methods in InterfacesAccess Specifiers for Classes or Interfaces in JavaAbstract Classes in JavaComparator Interface in JavaJava Interface MethodsNested Interface in Java...

Frequently Asked Questions in Interfaces

1. What is a marker or tagged interface?...