Answers for "how to handle terminal input in java"

1

how to read input in java

//For continues reading a line
import java.util.Scanner; 

Scanner in = new Scanner(System.in); 
while(in.hasNextLine()) {
   String line = in.nextLine();
   System.out.println("Next line is is: " + line); 
}
Posted by: Guest on September-23-2020

Code answers related to "how to handle terminal input in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language