Hi everyone, kindly help me with the following issue.
I am trying to complile a simple code as below.
When I compile class A using command C:\Users\Ajay\Documents\java_sandbox>javac A.java ....... it compiles fine
But when I compile Class B using the same C:\Users\Ajay\Documents\java_sandbox>javac B.java it gives the error as below....
C:\Users\Ajay\Documents\java_sandbox>javac B.java
B.java:2: error: cannot find symbol
class B extends A {
^
symbol: class A
B.java:8: error: cannot find symbol
System.out.println("The sum of i, j, k : "+(i+j+k));
^
symbol: variable i
location: class B
B.java:8: error: cannot find symbol
System.out.println("The sum of i, j, k : "+(i+j+k));
^
symbol: variable j
location: class B
3 errors
However when I compile the same code in Eclipse IDE , it works fine with no error at all. But the command prompt gives all these errors.I just don't want to touch the IDE until I complete the Core java part.
I have recently started studying Java and I am not able to compile any java file which uses extends in other words which uses Inheritance feature. Any help will be appreciated. Thanks in advance:)