If the input data is: "John, Michaels", the comma may produce an error. I'd try "John Michaels", and call Scanner.next() twice. If your still having problems, you can use Scanner.useDelimiter() or you could parse the line as one and call String.split().
No comments:
Post a Comment