import comp102x.IO;
public class testing {
private int x;
public testing(int x) {
x = x;
}
public static void main(String[] args) {
testing q1 = new testing(10);
IO.outputln(q1.x);
}
}
Why is the output 0 instead of 10? This is a JAVA script. The concept of instance and local variables is very confusing to me, can someone help to explain?
x = x;
?