#Input
30 messages · Page 1 of 1 (latest)
use print instead of println before nextLine
No i want to put my input first
like ill put pp for example as the name
and then for the next question to show up
instead of both of them prining
printing*
and when i put my input it only stores one of them
thats because of the method you're using to get input (nextLine). it's going to read up until it reaches a newline (hitting enter)
im confused what you're needing to be honest it looks like your input/output is working fine
I want it to Print "What would you like to name your Bee colony?"
and then i input the name
once i input the name "How many Bees do you want for your " +BName+ " colony?(1-5)" would show up
and i would put either a number 1-5
and then itll store it in the
BName and BSize variables
ahhh i see
ok so when you call nextInt to get B, you are typing the number in (lets say 1) then hitting enter. When you hit enter it create a newline character but nextInt() will not read it in... leaving it for the next method to pick up
so when you get inside that if statement and call nextLine()... its immediately picking up that leftover newline and carrying on to the next part
this is a good explanation + how you can fix it