wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Question about package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Question about package" Watch "Question about package" New topic
Author

Question about package

Daniel D. Guo
Ranch Hand

Joined: Jun 07, 2004
Posts: 30
Hello,

I developed a big program, now I want to split them into several files within the same package. I tried putting

package mypackage.task1;

and

import mypackage.task1.*;

for each file. But I got tens of "unresolved symbol" errors.

Any suggestions!

Dan
jiju ka
Ranch Hand

Joined: Oct 12, 2004
Posts: 306
Were you able to compile pre-splitted programs?

If not please post your programs.
Daniel D. Guo
Ranch Hand

Joined: Jun 07, 2004
Posts: 30
Dear Jiju,

The non-splitted program compiles fine. The program is the one for my SCJD test, so I guess I can not post it. Do you have any example that has a package structure with several inter-dependant programs.

Thanks,

Dan
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
If two classes are in the same package you don't need one to import the other. The package structure should match a directory structure, too. See if this writeup helps see how packages work.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question about package
 
Similar Threads
WA #1.....word association
IBM Test Question #4
Timestamp part of java? Import perhaps..
A JNI Question
Static Imports