This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Abhilash Q#76 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Abhilash Q#76" Watch "Abhilash Q#76" New topic
Author

Abhilash Q#76

Sandeep Potnis
Ranch Hand

Joined: Aug 18, 2000
Posts: 39
Can anyone please explain why option 1 is the right answer here.


1.The code will fail to compile. The class com.abhilash.abhilash can never be imported.
2.The code will compile. Runtime error occurs if one of the class in the import does not exist and is referenced.
3.The code will compile and run with out any problem.


Thanks
Sandeep
srikrish
Ranch Hand

Joined: Sep 12, 2000
Posts: 63
I have the same doubt myself. I don't undrstand why he says that the com.abhilash.ahilash can never be imported.
Could someone throw some light on this please.
Srikrish
Geek
Greenhorn

Joined: Sep 09, 2000
Posts: 21
Hello guys,
you people are overlooking a very basic fact. The package name and Class name cannot be identical. So, the class com.abilash.abhilash can never exist. A non-existant class can never be imported. A compile-time error is thrown.
Geek
[This message has been edited by Geek (edited September 16, 2000).]


geek@mantraonline.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Abhilash Q#76
 
Similar Threads
Confusion
about import
about import
import class
Packages