Scanner doesn’t read whole sentence – difference between next() and nextLine() of scanner class December 8, 2023 by Tarik This approach should work: String s = sc.next(); s += sc.nextLine();