Two Laptop Bag*
The moose likes Java in General and the fly likes [Tiger beta] static import Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "[Tiger beta] static import" Watch "[Tiger beta] static import" New topic
Author

[Tiger beta] static import

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8904

Hi all,

Brett mentions in his Java Tiger Devloper Notes that using *both* static and normal import for the same class will make compiler gripe about a name conflict. I tried this



The compiler did not complain. Why?
[ December 04, 2004: Message edited by: Pradeep Bhat ]

Groovy
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
I tried a lot of variations and they all worked.

import affects class names and import static affects member names. Since class and member names occupy different name spaces, I don't see how a conflict could happen even if the names were identical.


Mike Gershman
SCJP 1.4, SCWCD in process
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [Tiger beta] static import
 
Similar Threads
[Tiger beta] static import
Problem using package and import
What's the reason ?
Member Visible in Sub Class?
Static Imports