I have a code that takes input using scanner but the number of input is not defined. How to run the code in Netbeans?
The code is as follows:
Scanner scan = new Scanner(System.in);
while(scan.hasNextLine()){
// print the token
System.out.println(scan.next());
}
scan.close();
When I run the code, it is only taking input and no further processing is done.