How to accept a complete sentance as input in java
i tried using the following code but the code is excepting only the first word and not the entire sentance . plssss help here is the code Scanner scan =new Scanner(system.in); String s= scan.next(); system.out println("string is ",+s); my input: hello world output: hello
I believe you will need nextline() instead of next() ?
Use nextLine ()
use nextLine() to read full