After java 8 it is known that interfaces can have static methods and default methods.
Below is the example :
interface interA{
static void method()
{
System.out.println("Static method inside interface");
}
public default void AImp(){
System.out.println("Calling Aimp from interA");
}
}
Now my question is that why is static initialization block not allowed in interface.?
Example :
interface interA{
static void method()
{
System.out.println("Static method inside interface");
}
static
{
}
public default void AImp(){
System.out.println("Calling Aimp from interA");
}
}