class X { void ok() { interface Foo { void m(); default void m2() {} static void m3() {} } Foo foo = () -> {}; } void annotation() { @interface Anno {} } void modifiers() { static interface Intf1 {} private interface Intf2 {} public interface Intf3 {} protected interface Intf3 {} abstract interface Intf4 {} strictfp interface Intf5 {} final interface Intf6 {} } static int sf = 0; int f = 2; void capture() { int l = 5; final int cst = 2; interface Foo { int x = 2; void m(); default void m2() { System.out.println(l); System.out.println(f); System.out.println(sf); System.out.println(x); System.out.println(cst); } } } static void typeParameter() { interface Foo extends I { T t = null; } interface Foo1 extends I<T> {} } interface I {} class Box { void test() { interface LocalI { PARAM getParam(); } } } }