posted 17 years ago
Thanks, pretty helpful. Another question re:
"In line 1, a cup called x, of size int, is created and given the value 3.
In line 2, a cup called y, of size int, is created and given the value... 3.
The x variable is not affected!
Java COPIES the value of x (which is 3) and puts that COPY into y. "
So in Java, if I type int x = 3, int y = x, it COPIES whatever x is and puts it into y. It's as if I right clicked on x and pasted it to y, right? How would I have y reference x, as in if I changed x it would also change y? (Like in excel when you reference another cell and change that cell...)