[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: Import Problem



Hi Heston,

* Create a folder "MyPack". This folder will hold any
  of the classes that are part of the MyPack package.

* Move your Balance.java class to the MyPack folder.

* Switch to the MyPack folder. (To compile a package's
  class, you must switch to the folder in which the
  class's source code is stored).

* At the Command prompt, type "javac Balance.java".  
  Java's compiler then compiles the Balance.java file,
   creating the Balance.class file inyour "MyPack" 
  folder.

* Now try compiling the TestBalance class. It should
compile now without any errors.

Hope that helps

Regards,
Arun



> 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.*;
> ^> 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);
>                          
> 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);
>                          


__________________________________________________
Do You Yahoo!?
Yahoo! Calendar - Get organized for the holidays!
http://calendar.yahoo.com/