Bosun is right: without a package statement, the compiler will set the classes to use the default package, grouping the classes in the same directory into the package.
As for the compiler needing to know about the type information, javac is smart enough to find the class. I read this
here:
[If the search for a class] produces a source file but no class file: javac compiles the source file and uses the resulting class file.
Finally, to make it easier for yourself,
you should use a wildcard to compile your source files, like javac *.java