I have just began with Java and I am having a concept problem with an interactive program that I have developed. I have written a program that prompts a user to enter an integer character and a string character. Ex. 47 Red
After I implement the appropriate scanner features I would code.
System.out.println( " Please enter number and color");
int num = stdin.nextInt();
String color = stdin.next();
I am having problems with fixing this to prevent any errors. For example my program would crash if someone were to not enter a space between the two entries. Such as 45Red.
Is there a way to fix this?
I would appreciate any help.
This post has been edited by lahuerita2004: 02 June 2006 - 08:46 PM