display java output on pc monitor
This did not tell me how to get Java Project to my pc screen.... that was my question.
public static void main(String[] args)
This is the heading of the method main. A java class can have at most one method main. If java class contains an application program, such as the preceding program, it must contain the method main. When you execute the program, execution always begin with the method main.
The fourth line consists of a left brace(the second left brace of the program. This marks the beginning of the method main. The first right brace (on the eighth line of the program)matches the left brace and marks the end of the method main
System.out.println("My First Java Program");
This statement causes the program to evaluate whatever is in the parentheses and display the result on the screen. Typically, anything in double quotation marks, called a string, evaluates itself. Therefore causes the system to display the following line on the screen:
My first Java Program
Let us now consider the following statement:
System.out.println("The sum of 2 and 3 = " + 5);
In this output statement, the parenthesis consist of the string “The sum of 2 and 3 = “, + (the plus sign), and the number 5. Here the symbol + is used to join the strings. In this case, the system automatically converts the number 5 into a string, joins that string with the first string, and displays the following line on the screen:
The sum of 2 and 3 = 5
Let us now consider the following statement:
System.out.println("7 + 8 = " + (7 + 8));
In this output statement, the parenthesis consists of the string “7 + 8 = “, + (the plus sign), and the expression (7+8). In this expression (7+8), notice the parenthesis around 7+8. This causes the system to add the numbers 7 and 8, resulting in 15. The number is then converted to the string 15 and then joined with the string “7 + 8 = “. Therefore, the output of this statement is :
7 + 8 =15