I have a java package which contains two classes. Class A and Class B. I need to create an object of A type in class B. I don't know what is happening. Please someone help me out.
package pack;
class A
class B
I'm using JDK1.5 and tomcat and placed them in java folder in my D drive.
D:\java\jdk1.5
D:\java\tomcat
Right now, my package folder is also in above location
D:\java\pack
Below is how i am compiling my java class files.
Step 1: Compiling A.java
D:\Java\pack>set path=D:\java\jdk1.5\bin (setting up path for jdk1.5 compiler)
D:\Java\pack>javac A.java (Successfuly compiled and formed A.class)
Step 1: Compiling B.java
D:\Java\pack>javac B.java (here, i get an error message )
Below is the ERROR message
Error Message
D:\Java\pack>javac B.java
B.java:9: cannot find symbol
symbol : class A
location: class pack.B
A a = new A(); //creating an object of A type
^
B.java:9: cannot find symbol
symbol : class A
location: class pack.B
A a = new A(); //creating an object of A type
^
2 errors