Hi Everyone!!
i have two
java file A.java and B.java as
A.java contains
public class A{
A(){System.out.println("In class A");}
}
and B.java contains
public class B {
public static void main(
String[] args){
A obj1=new A();
}
}
both are placed in directory C
if i m compiling the A.java by C:\>javac A.java it works fine and A.class file created in directory C.
Now if i m compiling B.java by C:\>javac B.java it is showing error like can not find symbol A.
Also if we create only single file B.java as
class A{
A(){System.out.println("In class A");}
}
public class B {
public static void main(String[] args){
A obj1=new A();
}
}
and compiling by C:\>B.java it works fine with two .class (A.class and B.class)file created.
Can you help me to figure out What is the problem with first approach??
Thanks in advance
Prabhat