Why are interfaces allowed to have a main
method in Java 8?
As stated in below code it works fine and produces output properly.
public interface Temp {
public static void main(String args[]){
System.out.println("Hello");
}
}
Currently it is behaving like a class and I have executed interface
with main method.
Why do we need this?