I have a question about instance variables and local variables...
When you have an instance variable defined outside of every method but inside a class (say variable named "X"), and you create a local variable the same name ("X") within a certain method, will the instance variable get changed? There are two examples below.
private int X; private void test(int y) { int X; X = y; }
Will the variable X will be changed within the method, but will that change the instance variable X?
private int X private void test(int X) { X = X + 1; }
How about the example above? Does the local variable take precedence over the global variable in those cases?