I've started studying java using the tutorial on Oracle. I've been making a program as I've gone along in the tutorial, adding what I learn to the program. When I reached the packages section, I tried packaging my program. However, after I set up the package, my files couldn't find each other. After a couple frustrating hours of trying to fix it, I made a simple package with the following files:
C:\Users\Kenny\Desktop\testpackage\TestSuperClass. java:
- package testpackage;
-
public class TestSuperClass {
-
-
}
C:\Users\Kenny\Desktop\testpackage\TestSubClass.ja va (ignore the space)
- package testpackage;
-
public class TestSubClass extends TestSuperClass {
-
-
}
I can compile TestSuperClass.java, but when I compile TestSubClass.java, I get the following error:
- TestSubClass.java:2: cannot find symbol
-
symbol: class TestSuperClass
-
public class TestSubClass extends TestSuperClass {
-
^
I've set up the appropriate folders for the package and set the directory to my classpath. I've been trying to figure this out all day. Can someone explain to me what I'm doing wrong?