Tuesday, August 9, 2011

Java question. How do you get a user to enter their full name once asked?

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