Console log java

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
try(Scanner scan=new Scanner(System.in)){
// In java, read from console
String inputString=scan.nextLine();
//In Java, write to console
System.out.println(inputString);
}
try(Scanner scan=new Scanner(System.in)){ // In java, read from console String inputString=scan.nextLine(); //In Java, write to console System.out.println(inputString); }
try(Scanner scan=new Scanner(System.in)){
	// In java, read from console
	String inputString=scan.nextLine();
	//In Java, write to console
  	System.out.println(inputString);
}