Static methods in java interface – Java 8

Till java 7 static methods not supported by interface. But in java 8 we can declare static methods in interface.

Example Code (Interface)

public interface Car {
	public  static void printCarId(){

Here in above code we have one interface Car with one static method printCarId();.

Note :

1. Static methods must declare with body means we can not use abstract keyword with static methods.

2. Static methods cannot be overridden.