mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-26 05:57:44 +02:00
23 lines
422 B
Java
23 lines
422 B
Java
public interface PublicPackage {
|
|
//empty interface
|
|
}
|
|
|
|
|
|
//aspectj introduce a method to this interface
|
|
privileged aspect aspectWorld {
|
|
abstract void PublicPackage.world();
|
|
}
|
|
|
|
//class test implements hello interface, and
|
|
//method world
|
|
class test implements PublicPackage {
|
|
|
|
public void world() {
|
|
System.out.println("hello");
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
test t = new test();
|
|
t.world();
|
|
}
|
|
} |