I get a weird error from my code:
[line: 62]
Error: Syntax error on token “}”, delete this token
Anyone know how to fix this?
import java.util.Scanner;
import java.util.Random;
public class RockPaperScissors
{
public static void main(String[] args)
{
String humanChoice;
String computerChoice = "";
int rngInt;
String response;
Scanner rps = new Scanner(System.in);
Random generator = new Random();
System.out.println("It is time to play Rock, Paper, and Scissors!!!\n" +
"Please enter a move.\n" + "Rock = R, Paper" +
"= P, and Scissors = S.");
System.out.println();
rngInt = generator.nextInt(3)+1;
if (rngInt == 1)
computerChoice = "R";
else if (rngInt == 2)
computerChoice = "P";
else if (rngInt == 3)
computerChoice = "S";
System.out.println("Enter your play: ");
humanChoice = rps.next();
humanChoice = humanChoice.toUpperCase();
System.out.println("Computer play is: " + computerChoice);
if (humanChoice.equals(computerChoice)) {
System.out.println("It's a tie!");
}
else if (humanChoice.equals("R")) {
if (computerChoice.equals("S"))
System.out.println("Rock beats scissors. You win.");
else if (computerChoice.equals("P"))
System.out.println("Paper beats rock. You lose.");
}
else if (humanChoice.equals("P")) {
if (computerChoice.equals("S"))
System.out.println("Scissor beats paper. You lose.");
else if (computerChoice.equals("R"))
System.out.println("Paper beats rock. You win.");
}
else if (humanChoice.equals("S")) {
if (computerChoice.equals("P"))
System.out.println("Scissor beats paper. You win.");
else if (computerChoice.equals("R"))
System.out.println("Rock beats scissors. You lose.");
}
else
System.out.println("Select a Valid Input.");
} } }