posted 16 years ago
q-1:
non-static inner class can access all the members of outer class , inlcuding static and non static. while static inner class can acces only static members of outer class , so comilation error at line 6.
q-2:
whenever you put interface inside inner class , by defalut it becomes static. and non-static inner class can not have any static members except static final variables , so interface inside non-static inner class will generate error. while static inner class can have static members and so u can put interface as a member inside static inner class. and because of that compilation error at line 2.
Amisha Shah.<br />SCJP 1.4