Does there need to be a "main (...)" method declared in at least one class that is in a package? If so, does the class holding the "main(...)" method need to be in a class whose name is the same as the package name? Can you enlighten me on the proper use of naming and lauching packages.
Many thanks William
author and iconoclast
An application needs to have a main() for Java to be able to launch it. If main() is in a class that's in a package other than the default, it needs to be in a public class. The signature of main() must be
but if you want to use the "java" command on a class, it should have a main method that is in a class and the file containing it must have the same name as this class. it need not be public, but in that case, no other class in the file should be public. don't get confused, make a start somewhere and start exploring, a good place to ask such questions is the SCJP forum, you'll get replies with a lot of insights from beginners and experts
"It's not enough that we do our best; sometimes we have to do<br />what's required."<br /> <br />-- Sir Winston Churchill