Printing text with the Console class : Console « JDK 6 « Java






Printing text with the Console class

 

import java.io.Console;

public class Main {
  public static void main(String[] args) {
    Console console = System.console();

    console.printf("%s%n", "this is a test");
  }
}

   
  








Related examples in the same category

1.Java Console readLine
2.Password Prompting with java.io.Console
3.Console read Password
4.Console output with format
5.Masking a password with the Console class
6.Use Console class to read user input?