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.

Driver.java 515B

1234567891011121314151617181920212223242526272829303132
  1. // introductions calling super.
  2. import org.aspectj.testing.Tester;
  3. public class Driver {
  4. public static void test() {
  5. C2 c2 = new C2("FooBar");
  6. Tester.checkEqual(c2.name, "FooBar", "C2's name");
  7. }
  8. public static void main(String[] args) { test(); }
  9. }
  10. class C1 {
  11. public String name = null;
  12. public C1(String name) {
  13. this.name = name;
  14. }
  15. }
  16. class C2 extends C1 {
  17. C2() { super("dummy"); }
  18. }
  19. aspect A {
  20. C2.new(String name) {
  21. super(name);
  22. }
  23. }