How to make Scanner read the same line
I'm like to know how to make the 'Scanner' read the same line as the outputted text before it. i.e. askes a question, the user types the question on the same line and the scanner reads their input.
Below is what I've written so far:
The output should look something like this...
System.out.println("Please enter a number? ");
Scanner myScanner = new Scanner(System.in);
Number = myScanner.nextInt();
Please enter a number? 10
and then it gaves Number a value of 10.