You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PrivateSuperInnerAccess.java 297B

1234567891011121314151617
  1. public class PrivateSuperInnerAccess {
  2. public static void main(String argv[]) {
  3. Outer.C c = new Outer().new C();
  4. c.foo();
  5. }
  6. }
  7. class Outer {
  8. class B {
  9. private int x = 5;
  10. }
  11. class C extends B {
  12. int foo() {
  13. return super.x+1;
  14. }
  15. }
  16. }