hi Esther Kak ,
I 'managed' to reproduce your error because it always just seem to compile fine for me.
I get your error, when I execute compilation of the subclass without the superclass being on the same compilation line.
Position yourself in the folder of your
java files.
javac SubClassA.java gives me:
----
SubClassA.java:2: cannot find symbol
symbol: class SuperClassA
class SubClassA extends SuperClassA
^
SubClassA.java:5: cannot find symbol
symbol : variable superClassVarA
location: class Ekak.MyFavorites.Certification.KhalidMughal.PackageA.SubClassA
superClassVarA = 10;
^
SubClassA.java:6: cannot find symbol
symbol : variable superClassVarA
location: class Ekak.MyFavorites.Certification.KhalidMughal.PackageA.SubClassA
System.out.println("superClassVarA from subclass:"+superClassVarA);
^
3 errors
----
but when I execute
javac SubClassA.java SuperClassA.java
everything compiles just fine.
This error occurs because you try to compile a class (SubClassA) that needs a superclass (SuperClassA) but SuperClassA.class doesn't exist yet (or isn't found).