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.

Abstracts.java 554B

12345678910111213141516171819202122232425262728
  1. import org.aspectj.testing.Tester;
  2. public class Abstracts {
  3. static StringBuffer log = new StringBuffer();
  4. public static void main(String[] args) {
  5. new D().m();
  6. Tester.checkEqual(log.toString(), "D.m(), A.m(), A.m(), ");
  7. }
  8. public void m() {
  9. log.append("A.m(), ");
  10. }
  11. }
  12. abstract class C extends Abstracts {
  13. public abstract void m();
  14. public void n() {
  15. super.m();
  16. }
  17. }
  18. class D extends C {
  19. public void m() {
  20. Abstracts.log.append("D.m(), ");
  21. super.n();
  22. n();
  23. }
  24. }