java output to console code example

Example 1: java console write

System.out.println("Hello Console");

Example 2: java text ouput to console

System.out.println("Hello world!"); 
//This will be printed out to the console and requires no imports.

Example 3: console printing in java

public class writingInTheConsole {
  public static void main(String[] args) {
System.out.println("Hello Java! I made Minecraft: Java Edition!");
  }
}

Example 4: How to print in console java

public class ConsoleTest {
    public static void main(String[] args) {
        System.out.println("Console is: " + System.console());
    }
}

Tags:

Java Example