• Post Reply Bookmark Topic Watch Topic
  • New Topic

import problem  RSS feed

 
Bob CHOI
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
/*

Why did i get compilation error on code below? Thanks!

java:1: require '.'
import A;

*/






[ December 12, 2006: Message edited by: Bob CHOI ]
[ December 12, 2006: Message edited by: Bob CHOI ]
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you trying to do?
 
Bob CHOI
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tried to code something below, but failed on the "import statement"...

 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a class named A.java?
 
Bob CHOI
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if put them into non default package, then it works! ???

 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm still not clear on what you are trying to do. You cannot import classes in the default package.
 
Wiyanto Ngasinur
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are you trying to import class A that have the same package,
if it's so, that code wont work i think.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!