Code example for Console

Methods: printf

0
 
	public static void printf(String formatString, Object... args) {
		 
		try { 
			if (console != null) {
				console.printf(formatString, args);
			} else { 
				System.out.print(String.format(formatString, args));
			} 
		} catch (IllegalFormatException e) {
			System.err.print("Error printing...\n");
		} 
	} 
	 
	public static void print(String s) {
		printf("%s", s);
	} 
	 
	public static String readLine(String userPrompt) throws IOException {
		String line = "";
Contextual code suggestions in your IDE  Get Codota for Java