This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
K&B's Book say "Don�t forget that you can have a main() method with any legal signature you like, but if it isn�t public static void main (String  args), the JVM won�t be able to invoke it to start your program running."
That means static public void main (String  args) JVM won�t be able to invoke it to start your program running only public static void main (String  args) but i tested both envoking and it work. Can anybody clearify me this? what K&B try to say please? I am confused!!! [ August 07, 2007: Message edited by: Aaron Raja ]
"public static" and "static public" are interchangeable -- they mean exactly the same. But if you left out "static" (for example) altogether, then the method couldn't be used to launch your application. And more commonly, your arguments have to be an array of Strings (which can be written many different equivalent ways: "String args", "String args", "String anyOtherVariableName", and even "String... args" in Java 5 and up). But if you make your arguments (for example), an array of ints like "main(int args)", then again, it isn't valid.
JVM can invoke only main() to start your programme running and the main() should have the following features: 1. it should have String as parameter 2. it should be public, static 3. it should return void
public static void main (String args) is same as static public void main (String args)