I am working in C:/Myjava/
I have a package MyPack and a compiled public class Balance in it.
I go back to MyJava and create a NewClass that imports MyPack.* and calls a method on a Balance-type object reference. (All members in Balance are public)
NewClass does not compile if I write the import statement as
import MyPack.*;
returns error:
bad class file c:/MyJava/MyPack/Balance.class
class file contains wrong class MyPack.Balance
Please remove or make sure it appears in the correct subdirectory of classpath: Balance b=new Balance ("The balance is "+22000);
The error pointer shows at the type Balance in the above line
But if I write the import statement as
import MyPack.Balance;
everything works fine!!! ???
My Path and classpath respectively are as follows:
c:\j2sdk1.4.2\bin;c:\j2sdk1.4.2\jre\bin;c:\MyJava;c:\MyJava\Mypack
c:\j2sdk1.4.2\lib;c:\j2sdk1.4.2\jre\lib;c:\MyJava;c:\MyJava\MyPack
What is the problem?
Help help help please anybody. I am struck with such a simple program
