interface Hierarchy {
}
class Sub1 implements Hierarchy {
}
public class Ob {
public static void main(String[] args) {
Hierarchy hie = new Hierarchy(){};//not getting error line 11
Hierarchy hie1 = new Hierarchy();//while creating like this error line 12
}
}
hie
object created perfectly but hie1
is not creating throwing error that
Hierarchy is abstract cannot be instantiated
please tell me what happens if i put the {}
in line 11 what happens actually, why it is not throwing error, when i put {}
.