Reputation: 9
I understand the concept of taking an int value into a method which is effectively a copy of the int value, rather than the actual value and memory location.
Is there a way of changing the main integer value based on the result of the method?
If I return the int value to main can I do something like int num = int numIn where int numIn is the returned value. If yes the can it be used for multiple methods returns, so that the main int value changes after each consecutive method return ?
Upvotes: 0
Views: 598