Syntax error on token while printing strings
Hi, I am new at this. Really new :D I am trying to get the input for some names and then print out Player1 vs Player 2, but I'm getting a syntax error. The piece of code is: Scanner playerName = new Scanner(System.in); System.out.print ("Enter name for player 1: "); String player1 = playerName.next(); System.out.print ("Enter name for player 2: "); String player2 = playerName.next(); //test line - to be deleted later on System.out.print(+ player1 "vs." + player2); On the last line I am getting the following error: "Syntax error on token ""vs."", delete this token" I have tried without the pluses as well and it still does not work The initial last line was a different one, but I simplified it to see if it generates the same error. It was: System.out.println("Currently playing: " + player1 " against " + player2 ". Good luck!"); Any help on this would be very appreciated. Thanks!