Hello all,
I am new to the forum and am seeking some help on why my program is not working as expected . For some reason, my program skips over letting the user enter their town. I would be very grateful for any help that one may provide me with:
import java.util.Scanner; public class Okay { public static void main(String[] args) { String name, town; int age, siblings; Scanner details = new Scanner (System.in); System.out.println("Hey, what's your name?"); name = details.nextLine(); System.out.println("That's cool my friend is named " + name + " too!"); System.out.println("How old are you?"); age = details.nextInt(); System.out.println("Wow, my friend, " + name + ", is " + age + " years old" + " too!"); System.out.println("What town do you live in?"); town = details.nextLine(); System.out.println("This is getting kind of crazy... My friend, " + name + " lives in " + town + ", too!"); System.out.println("How many siblings do you have?"); siblings = details.nextInt(); System.out.println("STOP RIGHT THERE. THIS IS INSANE. My friend, " + name + ", has " + siblings + " siblings, too!!!"); System.out.println("Wait, " + name + ", is that YOU!?"); } }