Scanner scanner = new Scanner(System.in);
String str = scanner.next();
str += scanner.readLine();
String str = scanner.next(); ===> it fetch the 1st word of the line (hello world!! => "hello") str += scanner.nextLine(); ===> This method returns the rest of the current line, excluding any line separator at the end. (hello world!! => " world!!")