[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
Import Problem
Hi
I am trying to use packages. I have 2 classes
1)Balance.java
package MyPack;
public class Balance
{
String name;
double bal;
public Balance(String n, double b)
{
name = n;
bal = b;
}
public void show()
{
if(bal<0)
System.out.print("--> ");
System.out.print(name + ": $" + bal);
}
}
2)TestBalance.java
import MyPack.*;
class TestBalance
{
public static void main(String args[])
{
Balance test = new Balance("Heston",
99.99);
test.show();
}
}
The Balance.java compiles OK. But when I try and
compir the TestBalance.java file I get the following
errors
TestBalance.java:1: package MyPack does not exist
import MyPack.*;
^
TestBalance.java:7: cannot resolve symbol
symbol : class Balance
location: class TestBalance
Balance test = new Balance("Heston",
99.99);
^
TestBalance.java:7: cannot resolve symbol
symbol : class Balance
location: class TestBalance
Balance test = new Balance("Heston",
99.99);
^
3 errors
Could someone help me out. The JVM is on a linux
machine
Regards
Heston
__________________________________________________
Do You Yahoo!?
Yahoo! Calendar - Get organized for the holidays!
http://calendar.yahoo.com/