In between package and import statements, no other statement can appear.
And this whole compilation unit is wrong. A compilation unit can have only one public class.
When it's obvious that you have to do it, just do it without shattering your thoughts over different directions.