File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "package" Watch "package" New topic


Dennis Liu

Joined: Dec 03, 2003
Posts: 9
I created my own aplication(myApp) under webapps,I put all my own classes under /myApp/WEB-INF/classes.It works fine
I want to put my classes in order.So I created two folders /myApp/WEB-INF/classes/myPackageA and /myApp/WEB-INF/classes/myPackageB
How can one class( under /myApp/WEB-INF/classes/myPackageA use other class ( under /myApp/WEB-INF/classes
or ( /myApp/WEB-INF/classes/myPackageB?
I put "package myPackageA;" in the first line of and
"package myPackageB;" in the first line of doesn't work.
How these classes(,, can use each other?
Thanks Dennis
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Use import myPackageB.*; in the
Use import myPackageA.*; in the
to import those packages' classes...
But all classes under the /WEB-INF/classes/ is available to all classes by default implementation of the web container...
One thing don't forget to compile the codes again with the package name specified... Hope it helps....

Co-author of SCMAD Exam Guide, Author of JMADPlus
Siripa Siangklom
Ranch Hand

Joined: Jan 26, 2004
Posts: 79
Don't forget add "public" precede your class keyword such as
public class A {}
zhu a ming

Joined: Oct 05, 2003
Posts: 9

=======================<br />s=(LinkNode *)malloc(sizeof(ListNode));<br /> s->date=ch;<br /> s->next=head;<br /> head=s;<br /> ch=getchar();
I agree. Here's the link:
subject: package
It's not a secret anymore!