I am having troubles working through a package example. I have a directory named Flora where my source code is located (along with the compiled class files). The following code compiles/executes fine:
The last line prints out and everything is great. However, when I uncomment the first line in the first file and the first two lines in the second file, the programs will still compile but I get a java.lang.NoClassDefFoundError:Forest2 (wrong name Flora/Forest2). Can some shed some light on this for me?
I found the answer to my question above. If I remove the package statement in the second file, everything works fine. I think it is because I am trying to put a class (Forest2) into the same package that I am trying to import from (Flora). Is this a correct assumption?