There’s an extended discussion of how Java passes variables at an earlier question “Is Java pass by reference?”. Java really passes object references by value.
In your code, the references for the arrays (which are objects) are passed into
calculate(). These references are passed by value, which means that any changes to the values of
c are visible only within the method (they are really just a copy of
t_ccc). That’s why
main() was never affected.
To reinforce this concept, some programmers declare the method parameters as
public static void calculate(final int b, final int c)
Now, the compiler won’t even allow you to change the values of
c. Of course, the downside of this is that you can no longer manipulate them conveniently within your method.