File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Java in General
Bookmark "[Tiger beta] static import" Watch "[Tiger beta] static import" New topic

[Tiger beta] static import

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8927

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 ]

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:
subject: [Tiger beta] static import
It's not a secret anymore!