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"); } }