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.

CalleeBefore.java 591B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package test1;
  2. class CalleeBeforeParent {
  3. static int counter = 0;
  4. int r;
  5. CalleeBeforeParent(int k) {
  6. System.out.println("CalleeBeforeParent:" + k);
  7. r = counter;
  8. }
  9. }
  10. public class CalleeBefore extends CalleeBeforeParent {
  11. public int p;
  12. public static int q;
  13. public CalleeBefore() {
  14. this(3);
  15. }
  16. public CalleeBefore(int k) {
  17. super(k);
  18. p = q = 0;
  19. }
  20. public int m1(int i) {
  21. return p + i;
  22. }
  23. public static int m2(int i) {
  24. return q + i;
  25. }
  26. public int getr() { return r; }
  27. public int test() {
  28. return m1(3) + m2(10);
  29. }
  30. }