Skip to content
singhalmanu9 edited this page Dec 3, 2014 · 1 revision

In this tutorial, we will show how to send output to the console. In Java, the easiest way to do this is to use the console. Firstly, create a new program with a main method and make sure that it has a public static void main(String[]args).Inside of this method (inside the curly braces {}),in a new line, write System.out.println("Hello World!");

Using this, you can now output whatever you want to the console! Replace Hello World! with your name and see what happens. Remember to use the quotation marks to indicate a String of letters.

Output to the console is one of the many ways programmers can debug their programs. By outputting the current value of a variable for each iteration in a loop, the programmer can make sure that the loop is functioning properly and that the code is being executed in the manner he/she wants it in.

Clone this wiki locally