R
rajesh.shiggaon
Hi all:-
I know this question seems very basic, but i am really pissed out, so
please help me out
I have saved this file in aClass.java and its compiling and placed the
class file in the somepackage directory.
this class is saved in the pTest.java file and saved in the parent
directory of somepackage. But when i compile this its giving me error
such as:-
pTest.java:7: cannot access aClass
bad class file: ./aClass.java
file does not contain class aClass
Please remove or make sure it appears in the correct subdirectory of
the classpath.
aClass.method();
^
1 error
When i replace the import statement with this one this one import
somepackage.aClass; its compiling and running.
Am i missing out something ???
Thanks in advance.
Rajesh s
I know this question seems very basic, but i am really pissed out, so
please help me out
Code:
package somepackage;
public class aClass {
public static void method(){
System.out.println("Inside the aClass and method");
}
}
I have saved this file in aClass.java and its compiling and placed the
class file in the somepackage directory.
Code:
import somepackage.*;
public class pTest {
public static void main(String args[]){
System.out.println("Inside the main method");
aClass.method();
}
}
this class is saved in the pTest.java file and saved in the parent
directory of somepackage. But when i compile this its giving me error
such as:-
pTest.java:7: cannot access aClass
bad class file: ./aClass.java
file does not contain class aClass
Please remove or make sure it appears in the correct subdirectory of
the classpath.
aClass.method();
^
1 error
When i replace the import statement with this one this one import
somepackage.aClass; its compiling and running.
Am i missing out something ???
Thanks in advance.
Rajesh s