Hello everyone,
I just started studying
java and I found one thing that is making me a bit confused. Please, consider the following code:
My intention with the above code was to understand how does the default access to a class works (and a class member). As I could understand, once the classes are in the same package, it is possible to use the class C (in the file A.java) in the code of class B (in the file B.java). However, I'm getting the following error after trying to compile B:
C:<my path>\src>javac -d ../bin test/B.java
test\B.java:5: cannot find symbol
symbol: class C
public class B extends C{
^
1 error
The directory structure is as follows:
/root
--------/src
-------------/test
------------------A.java
------------------B.java
------- /bin
------------/test
-----------------A.class
Does anybody have any idea about why I can't access the C in the class B, even both belonging to the same package?
Thank you very much.