In both the "main" method and "getvalue" method the variable "one" and "two" are local variables. So the reference change for the variable "two" in the "getvalue" method doesn't reflect the variable "two" in the main method.

The main() method is static, but getValues() is not - you cannot call a non-static method from a static one

Please make sure that the code example you post is correct. In this case the question was simple to understand, but making simple mistakes like that can confuse people who want to answer your question.