Class 1:
view sourceprint?
1 public class one {
2 public static void main(String[] args){
3 int num = 0;
4 System.out.println(num);
5 two.change(num);
6 System.out.println(num);
7 }
8 }
Class 2:
view sourceprint?
1 public class two {
2 static void change(int num){
3 num = num + 1;
4 }
}
This should print 0, then 1, but it prints 0, then 0. How do I make it print 0 then 1 with the same format?