October 2017
Beginner
318 pages
7h 26m
English
Well, let's take a look at what happens when we pass x to a method by value. As we know, when we pass a variable by value, we're telling Java to create a new variable in the context of the method that's going to have its own unique name and memory location:

However, this new variable-in our case, input-takes the value from the old variable as its own. When we were working with primitive types, these values were completely independent, but now both input and x have the values of the same location in memory. So, while modifying the value of input would not change the value of x, modifying the location of memory ...
Read now
Unlock full access