You can not put different packages into the same source file... You have to create the appropriate folder structure, and separate Java source files for the sources in each package...
Also, to be able to reference classes from other packages, you have to import
them appropriately, and make sure they are actually on the classpath both for compiling and running too......