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.

Basic3.java 459B

123456789101112131415161718192021222324252627282930313233
  1. public class Basic3 {
  2. public static void main(String []argv) {
  3. Basic3 b = new Basic3();
  4. if (!(b instanceof X.I)) throw new RuntimeException("Basic3 should implement I");
  5. ((X.I)b).m2();
  6. ((X.I)b).m3();
  7. ((X.I)b).m2();
  8. ((X.I)b).m4();
  9. }
  10. }
  11. aspect X {
  12. interface I {
  13. }
  14. public void I.m2() { }
  15. public void I.m3() { }
  16. public void I.m4() { }
  17. declare parents: Basic3 implements I;
  18. before(): call(* m*(..)) {
  19. }
  20. }