@@ -0,0 +1,8 @@ | |||
package pkg; | |||
public aspect Base { | |||
public interface BaseBean {} | |||
public String BaseBean.describe() { | |||
return "Base holds "+super.toString(); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
package pkg; | |||
import pkg.Base.BaseBean; | |||
public aspect Derived { | |||
public interface DerivedBean extends BaseBean {} | |||
public String DerivedBean.describe() { | |||
return "Derived state plus "+super.describe(); | |||
} | |||
public static void main(String args[]) { | |||
new DerivedBean() {}.describe(); | |||
} | |||
} |