JAVA – Console Output Commands

Just as the Console Input command, accepts the user defined input, the Console. Output command displays the output on the monitor. In the Java programming language, you can write programs that write text lines to the console, which is a DOS based command window.

Though it’s not as popular as a Graphical User Interface or a GUI, the Console.Output command is used sometimes by programmers. Also, the Console.Output command doesn’t work properly with applets, WebStart applications and normal GUI programs. A sample code that shows the dialog or the console output program for simple input/output command is shown below:

public class example_Console_Output

{

public static void main(String[] args) {

System.out.println(“Hello, This is the example of Console Output command. “);

}

}

The System.out.println command is used to display an entire line of output on the console. The message passed as an argument to the System.out.println command is printed on the console. The println is the short form of print line command and originates from the Pascal programming language.