Get Input – Java Code Example

Snippet 1

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

Snippet 2

  InputUSer Scanner 

Copyright © Code Fetcher 2020

 

 

Published

Leave a comment

Your email address will not be published. Required fields are marked *