so i m trying to take all these string inputs from the user. now the problem i m facing is that i m getting output like this when i select case 2. Why are the line first and second both printed together. Cant figure it out. thanks in advance.
Output is
You've chosen item #2
Enter the Street Address of the house:
Enter the name of the town
case 2:
System.out.println("You've chosen item #2");
System.out.println("Enter the Street Address of the house:");
String streetAddress = sc.nextLine();
System.out.println("Enter the name of the town");
String nameTown = sc.nextLine();
System.out.println("Enter the postcode of the town");
String townPostcode = sc.nextLine();
System.out.println("Enter the name of the landlord:");
String landLordname =sc.nextLine();
System.out.println("Enter the contact number of the landlord:");
String landlordContact = sc.nextLine();
System.out.println("Enter the name of the tenant if any or enter null");
String tenantName=sc.nextLine();
System.out.println("Enter the contact number of the tenant if any or enter null");
String tenantContact = sc.nextLine();
System.out.println("Enter the rent of the house if any or enter null");
String rent =sc.nextLine();
System.out.println("Enter the number of weeks in the lease contract or enter null");
int lease = sc.nextInt();`