• + 3 comments

    i have a question if u try s = sc.hansNext(); , it ouptputs the 1st word in the next line's string , shouldn't it also read the enter key ( empty output) instead of jumping to the next like nextLine() did in our case.

    next() places the cursor in the same line after reading the input.

    nextLine() positions the cursor in the next line ater reading output