Name: OP 2010-04-20 0:00
trying to get a java program to read names with spaces in them. I know space is the default delimiter, and using next() will read only up to that. The solution is supposed to be to use nextLine() instead. My problem is that this completely skips the input, and just goes to the next lines of codes without giving any chance to input anything. My scanner is declared static, but I don't really see how this could be causing any problems, it's reading everything else fine.
All code related to this:
System.out.println("What is the name of this new member?(Include the tag)");
input = scan1.nextLine();
System.out.println(input);
System.out.println("What is this new member's age?");
ageinput = scan1.nextInt();
no chance to input for name, goes straight to input for age.
All code related to this:
System.out.println("What is the name of this new member?(Include the tag)");
input = scan1.nextLine();
System.out.println(input);
System.out.println("What is this new member's age?");
ageinput = scan1.nextInt();
no chance to input for name, goes straight to input for age.