File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating a package

 
Deon Smith
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to create some packages. But I'm getting a compile error when I try to compile the second class in the other package.
package pack1;
public class PackOne {
protected int a = 9;
}
package pack2;
public class PackTwo extends PackOne {
//do something
}
I'm getting an error stating that PackOne cannot be resolved.
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Deon,
You need to import the package to make its contents visible. So just add:

after the package statment and before the class definition and PackTwo should compile fine.
Hope this helps,
Michael Morris
[ August 11, 2002: Message edited by: Michael Morris ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic