Scanner in=new Scanner(System.in); 		String input=in.nextLine(); 		String[] word=input.split(" ");

Read more of this post