Forums Register Login

problem with custome package

+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
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
Well behaved women rarely make history - Eleanor Roosevelt. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 610 times.
Similar Threads
Problem with Package execution
package trouble
compile interface error
Trouble with packages.
package problem
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:54:37.