only this code should run otherwise this code should
not run. because if a string doesn't have any space
inbetween then the above code will give error.
At this point, it would be a good idea to familiarize yourself with the String API. That way, you'll have a better idea how to accomplish your specific requirements.
String s = "aquarium a"; s = s.split("\\s"); assert s.equals("aquarium");