Java Scanner Read String With Spaces, Such that … How do I scan a space in Java? nextLine () if you want to read the whole line.