Click here to Skip to main content
15,883,990 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I used input.nextLine() but still it doesn't count spaces as input. Instead, word after spaces will be the input for next output I ask.

What I have tried:

System.out.println("\nInsert new attraction\n---------------------------------");
					if(choiceAttraction==1) {
					System.out.println("[Sport]");
					System.out.print("ID: ");
					int SI = input1.nextInt();
					System.out.print("Name: ");
					String SN = input.nextLine();
					System.out.print("Operating Hours: ");
					String SH = input.nextLine();
					System.out.print("Main Activity: ");
					String SA = input.nextLine();
					System.out.print("Location: ");
					String SL = input.nextLine();
					System.out.print("Rating: ");
					double SR = input1.nextDouble();
					attraction.add(new Sport(SI, SN, SH, SA, SL, SR));
Posted
Updated 11-Feb-18 4:26am
Comments
wseng 11-Feb-18 9:54am    
I don't see any error .

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900