This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) 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 » Certification » Programmer Certification (SCJP/OCPJP)
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: 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 ]

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
Similar Threads
[Tiger beta] static import
Problem using package and import
What's the reason ?
Member Visible in Sub Class?
Static Imports