Can't stop inputting data. Did anyone get the same trouble like me ?
I tried with command line and JCreator, it's ok so this is error belongs to
netbeans.
I don't like using "\r\n" or "\n" because it won't work on different OS.
Then I used "line.separator".
The code I referred above:
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
scanner.useDelimiter(System.getProperty("line.separator"));
System.out.println("Input:");
String name = scanner.next();
}
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---