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.

CalleeAfter3.java 706B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package test1;
  2. public class CalleeAfter3 {
  3. int value = 1;
  4. public int m1(int k) {
  5. if (k > 3)
  6. return k;
  7. else
  8. return k + 1;
  9. }
  10. public String m2(int k) {
  11. if (k > 3)
  12. return "value" + k;
  13. else
  14. return "value" + value;
  15. }
  16. public void m3(int k) {
  17. if (k > 3)
  18. value += k;
  19. else
  20. value -= k;
  21. }
  22. public int m4(String obj) {
  23. try {
  24. return obj.length();
  25. }
  26. catch (NullPointerException e) {
  27. return 0;
  28. }
  29. }
  30. public int test() {
  31. m3(5);
  32. return m1(1) + m2(5).length() + value + m4("12345");
  33. }
  34. }