View Single Post
Old 09-06-2012, 09:58 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,650
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
I don't understand your question.
System.out.println is required in order to print out text to the screen in Java CLI. You cannot just place "Hello World" on a line and have it displayed on the screen.

public static void main(String[] argv) is required. This is the entrance method to the application, and at least one main method is required in order to execute the application. When you create a jar, you can specify which class' main method will be the application entrance point. Calling java does not allow you to specify what method is called, so therefore you must call java on an entire class which resolves the main method as the entrance. This is the same in a lot of lanauges; C# and C both have the main methods, and languages like PHP use dummy main() in any userspace code not blocked into a function.
Fou-Lu is offline   Reply With Quote