Community
Participate
Working Groups
I2003-11-19 I am able to compile the following method: public static void main(String[] args) { String String= "foo"; System.out.println(String); } I'm just wondering if the use of "String" as a variable name is actually legal.
Yes, this is indeed allowed as there is no ambiguity due to the grammar in between a type and a variable in this case. If it was part of a qualified name, then the variable would take precedence.