I want to be able to enter a number using nextInt() and then print text on the same line as the number I entered. For example...
Scanner scan = new Scanner(System.in);
System.out.print("Enter your number: ");
int x = scan.nextInt(); //After you press 'enter' it goes to the next line and keeps printing text
System.out.print("I want this on the same line as my number!");
And the output would look something like this:
Enter your number: 4356
I want this on the same line as my number!
Is there a way I can get the text to print right after the number? So it would look something like this?...
Enter your number: 4356 I want this on the same line as my number!