I know this code is terribly written (first day of Java and programming), but I am writing a code in Java that will take an input from the user (the dice) and produce a random number from that dice. I have added a while loop to ask if the user would like to restart the program, but everytime I run it it tells me that it is an invalid input before I have inputted anything. Please help.
import java.util.Scanner;
import java.util.Random;
public class Java {
public static void main(String args[]){
    Scanner input = new Scanner(System.in);
    String restartChoice = "y";
    while (restartChoice == "y" || restartChoice == "Y"){
        int choice;
        System.out.println("Please choose which dice you would like to                       roll. 4/6/12 ");
        choice = input.nextInt();
        while (choice != 4 && choice != 6 && choice != 12){
            System.out.println("That is not a valid input, please try again... ");
            choice = input.nextInt();   
        }
        Random rand = new Random(); 
        int value = rand.nextInt(choice) + 1;
        System.out.print("You chose to roll the ");
        System.out.print(choice);
        System.out.print(" sided dice. The number is ");
        System.out.println(value);
        System.out.println("Would you like to restart? Y/N ");
        restartChoice = input.nextLine();
        while (restartChoice != "y" && restartChoice != "n" && restartChoice != "y" && restartChoice != "n"){
            System.out.println("That is not a valid input. Please try again. ");
            restartChoice = input.nextLine();
        }
    }
}
}
 
     
    