This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there way to import static methods from a non-package class?

 
Zemian Deng
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a class that doesn't have package name(default to .) with many static methods. I can't seem to import these without hitting compiler error. The only solution I have is to add a package declaration to the class. Is there a way to do it without it?

I have the following:


Thanks,
Zemian Deng
 
Bill Shirley
Ranch Hand
Posts: 457
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java Spec, �7.5, Import Declarations

"It is a compile time error to import a type from the unnamed package."
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Zemian Deng:
... The only solution I have is to add a package declaration to the class...

That's the way to do it.

Is there a reason that you want to use an unnamed package?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic