General Java help in Scripting Help Posted April 8, 2017 public class MyClass { public static void main (String[] args) { int x = 5; addOneTo(x); System.out.println(x); } static void addOneTo (int num) { //You have to pre increment to see the result after referencing x ++num; } }
General Java help
in Scripting Help
Posted
public class MyClass {
public static void main (String[] args) {
int x = 5;
addOneTo(x);
System.out.println(x);
}
static void addOneTo (int num) {
//You have to pre increment to see the result after referencing x
++num;
}
}