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.

PackagePackage.java 454B

123456789101112131415161718192021222324252627
  1. interface PackagePackage {
  2. //empty interface
  3. }
  4. //aspectj introduce a method to this interface
  5. privileged aspect aspectWorld {
  6. abstract void PackagePackage.world();
  7. // void test.andy() {
  8. //
  9. // }
  10. }
  11. //class test implements hello interface, and
  12. //method world
  13. class test implements PackagePackage{
  14. public void world() {
  15. System.out.println("hello");
  16. }
  17. public static void main(String[] args) {
  18. test t = new test();
  19. t.world();
  20. }
  21. }