aspose file tools*
The moose likes Beginning Java and the fly likes problem with custome package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "problem with custome package" Watch "problem with custome package" New topic
Author

problem with custome package

billakanti narendra
Greenhorn

Joined: Nov 04, 2005
Posts: 1
hi im narendra
im new to java..
i have a problem in importing custome package

the following 2 programs

1) hello.java
package wish;
public class hello
{
public static void call()
{
System.out.println("Hello World!");
}
}

2) wishing.java

import Wish.*;
public class Wishing
{
public static void main(String[] args)
{
hello.call();
}
}
it is giving me error
Wishing.java:7: cannot access hello
bad class file: .\hello.java
file does not contain class hello
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
hello.call();
^
1 error
[ November 08, 2005: Message edited by: billakanti narendra ]
Ernesto Elias-Nieland
Ranch Hand

Joined: Sep 01, 2005
Posts: 53

Hi Narenda!

Your class hello is in the package wish. So you have to import the package wish.hello in your class Wishing to access the static method call.

Ernie


0x2B | ~0x2B
SCJD, SCJP 1.5, SCJP 1.4, SCBCD 1.3, SCWCD 1.4, SCJA, IBM Test 150, 142, 700, 701, Oracle Test 1Z0-51
 
wood burning stoves
 
subject: problem with custome package