ERROR - Java 8 - Syntax error on token "default", delete this token


Syntax error on token "default", delete this token while working with Interfaces and Java 8

Error Type

Compile Time

Possible Cause 1

Default methods have been introduced and legitimate with Java 8. The code might have been built with version 7 or earlier.

Possible Cause 2

Default might have been specified with interface static member elements. 

Possible Resolution

Make sure that you are building the code using JDK 8 or Java 8

If you are using Eclipse 

Go to Windows -> Preferences -> Java - > Compiler and make sure that the JDK and compliance level is 1.8

If you don't intend to build the code with JDK 8, Remove the default keyword and the method body from the interface method.