您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

HasField.aj 317B

12345678910111213141516171819
  1. public aspect HasField {
  2. declare parents : hasfield(* printer) implements Printable;
  3. public static void main(String[] args) {
  4. C c = new C();
  5. if (! (c instanceof Printable)) {
  6. throw new RuntimeException("declare parents : hasfield failed");
  7. }
  8. }
  9. }
  10. class C {
  11. int printer;
  12. }
  13. interface Printable {};