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.

NewRemover.java 546B

123456789101112131415161718192021222324252627282930
  1. package test4;
  2. public class NewRemover {
  3. static NewRemover obj = new NewRemover(7);
  4. int value;
  5. static int value2 = 5;
  6. public NewRemover() {
  7. this(3);
  8. }
  9. public NewRemover(int k) {
  10. value = k;
  11. }
  12. public int run() {
  13. return make();
  14. }
  15. public int make() {
  16. NewRemover nr = new NewRemover(value2 > 0 ? 3 : 0);
  17. return nr.value;
  18. }
  19. public static NewRemover make2(int z) {
  20. System.out.println("make2 " + z);
  21. obj.value += z;
  22. return obj;
  23. }
  24. }