//Example:
Scanner scanner = new Scanner(System.in);
String character = scanner.next();
//User hits the space bar and hits enter
System.out.println(character);
//character should = " "
//Example:
Scanner scanner = new Scanner(System.in);
String character = scanner.next();
//User hits the space bar and hits enter
System.out.println(character);
//character should = " "
scanner.next() gives you the next complete token, which is defined as follows:
A complete token is preceded and followed by input that matches the delimiter pattern.
If you want the space, I'm assuming you want the whole line. You should either tell the scanner to get the entire line or set the delimiter of the scanner to the line break character. See scanner.nextLine() and scanner.useDelimiter().