This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes Is it a bug............. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Is it a bug............." Watch "Is it a bug............." New topic
Author

Is it a bug.............

Sandeep Jain
Ranch Hand

Joined: Oct 25, 2000
Posts: 124
Can any one explain me
Why this peace of code compile Properly
import java.lang.*;
class String
{

}
and this doesn't
import java.lang.String;
class String
{

}

------------------
Sandeep Jain


Try and Try Till u succeed<br /> <br />Sandeep Jain
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
Explicitly importing a class forces the current compilation process to treat that class as already defined. Importing a whole package just allows the compilation process to "see" those classes, if required.
So trying to redefine String will be an error.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Is it a bug.............
 
It's not a secret anymore!