File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Abhilash Q#76

 
Sandeep Potnis
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic