This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with custome package

 
billakanti narendra
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 53
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic