Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Importing Classes in default package

 
swarna dasa
Ranch Hand
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to import classes in default package (having no package statement at all)?

Have a file
Test.java

public class Test {
}

Have another file Test2 in package com

package com;
public class Test2 {
public static void main(String[] args) {
//Test test = new Test();
}
}

Is there any way of importing Test.java?
 
Keith Lynn
Ranch Hand
Posts: 2399
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No you cannot import them unless they are in a package.

As long as the directory containing the .class file is in the CLASSPATH, you should be able to use the type.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic