Hi Ben,
Variable declarations appearing inside any set of curly braces (a "block") are local to that block. You declared three different variables, all with the same name, each local to the block it's defined in.
Note that you can't just remove the braces: a declaration by itself isn't a legal statement and so can't be the body of a conditional.
What you have to do is declare the variable before the conditional, and then tentatively assign to it:
I'm going to move this to
Java in General (Beginner), because it's really unrelated to
Servlets. You can follow up there.
[ August 01, 2005: Message edited by: Ernest Friedman-Hill ]