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.

QualifiedNewCP.java 727B

1234567891011121314151617181920212223242526272829
  1. public class QualifiedNewCP {
  2. public static void main(String[] args) {
  3. Base b = new Base();
  4. I o = b.new Inner();
  5. o.m();
  6. o = b.new AbstractInner() { public void m() { System.out.println("mi"); helper(); } };
  7. o.m();
  8. o = b.new Inner() { public void m() { System.out.println("mi"); } };
  9. o.m();
  10. }
  11. }
  12. class Base {
  13. class Inner implements I {
  14. public void m() { System.out.println("m"); }
  15. }
  16. abstract class AbstractInner implements I {
  17. //public abstract void m();
  18. protected void helper() { System.out.println("helper"); }
  19. }
  20. protected void foo() {
  21. System.out.println("foo");
  22. }
  23. }
  24. interface I {
  25. public void m();
  26. }