Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

This question is 6 years old and lot of things have changed the definition of interface over the years.

From oracle documentation page ( post Java 8 release) :

In the Java programming language, an interface is a reference type, similar to a class, that can contain only constants, method signatures, default methods, static methods, and nested types. Method bodies exist only for default methods and static methods. Interfaces cannot be instantiated—they can only be implemented by classes or extended by other interfaces.

Have a look at related SE questions for better explanation:

Is there more to an interface than having the correct methodsIs there more to an interface than having the correct methods

What is the difference between an interface and abstract class?What is the difference between an interface and abstract class?

This question is 6 years old and lot of things have changed the definition of interface over the years.

From oracle documentation page ( post Java 8 release) :

In the Java programming language, an interface is a reference type, similar to a class, that can contain only constants, method signatures, default methods, static methods, and nested types. Method bodies exist only for default methods and static methods. Interfaces cannot be instantiated—they can only be implemented by classes or extended by other interfaces.

Have a look at related SE questions for better explanation:

Is there more to an interface than having the correct methods

What is the difference between an interface and abstract class?

This question is 6 years old and lot of things have changed the definition of interface over the years.

From oracle documentation page ( post Java 8 release) :

In the Java programming language, an interface is a reference type, similar to a class, that can contain only constants, method signatures, default methods, static methods, and nested types. Method bodies exist only for default methods and static methods. Interfaces cannot be instantiated—they can only be implemented by classes or extended by other interfaces.

Have a look at related SE questions for better explanation:

Is there more to an interface than having the correct methods

What is the difference between an interface and abstract class?

Source Link
Ravindra babu
  • 39.2k
  • 11
  • 258
  • 222

This question is 6 years old and lot of things have changed the definition of interface over the years.

From oracle documentation page ( post Java 8 release) :

In the Java programming language, an interface is a reference type, similar to a class, that can contain only constants, method signatures, default methods, static methods, and nested types. Method bodies exist only for default methods and static methods. Interfaces cannot be instantiated—they can only be implemented by classes or extended by other interfaces.

Have a look at related SE questions for better explanation:

Is there more to an interface than having the correct methods

What is the difference between an interface and abstract class?

Post Made Community Wiki by Ravindra babu