it is becoz of the scope of the variable
one declare out side the function is in the Global Scope
and other one is inside the Function having the Function Scope
now how question is if the variable name is same then... how does it works...
Answer is ...
by help of scope operator(i am not sure it is operator or not sorry to say i forgot) "::"
if the variable is in the global scope the ::<variable>
if there is no ambiguity in the name of the variable then the scope resolution operator is not need ...
Maybe it's one of those things like it's valid to use OR instead of || or AND instead of &&, or that a comma is an operator, etc. But, yeah, it would be interesting if those who have access to a copy of the standard or know the relevant section of the standard would post a report.
public class GrossmontBank
//class variables (global - accessible throughout this class)
//scanner object to be used throughout
private static Scanner input = new Scanner(System.in);