The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
December 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Thank you

Posted by siva on December 20, 2000 at 5:11 AM

Thank you for your answer. I have more doubt.Let assume both files
are placed inside a directry as a package.
Consider this
This is first file
pacakge package1;
public class Box {
public Box(int a, int b){
int len = a;
int wid = b;
}
}
I stored this file in package1 directry
Then next file is

package package1;
public class Test {
Box box= new Box(2,4);

}
I stored this also in package1 directry. Then I compile first one
no error message.But when compiling second one the error message is
"class package1.Box not found".Here also same message.But when I remove
package statement from both files that means both files are in default
package, no error message
I couln't find the reason. If you know please tell me
Thank you





Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us