Bug 46921 - Type name as variable name allowed
Summary: Type name as variable name allowed
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-19 04:45 EST by Thomas M??der CLA
Modified: 2003-11-19 07:47 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas M??der CLA 2003-11-19 04:45:15 EST
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.
Comment 1 Philipe Mulet CLA 2003-11-19 07:47:36 EST
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.