This is kind of stupid question and I could not find a clear answer to my problem. Here is where my confusion is coming from:
I know that in a .java file there can be only one top public class and the file name needs to have the name of that public class (say MyPublicClass.java). Now, I have more than one class in that .java and there is interaction between all of them (eg an instance of a class may call a method in a different class).
When I compile that .java, the compiler will create a separate .class file for each of those classes... and I do 'java MyPublicClass' to run my lousy code
So, I wonder, if I want to have all those classes public (not sure why), I have to create a .java file for each of them and compile then separately, how else ?
How can I compile all those .java files and how to I run my code ('java ...') by calling only one of them so all of them would run like a unit ? or, how is it really done ?
Thank you for your patience and have a good weekend (since it's Friday eve today