Hey. I have a problem with the following program. When the loop ends and asks if I want to repeat the whole loop, if I answer Yes, the program does not continue and it ends at that point.

import java.util.Scanner;
import java.util.*;

public class MyTest {

public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String answer = "Yes";
while (answer == "Yes") {
System.out.print("Input the times you would to roll the dice: ");
int rolls = in.nextInt();
for (int i=1; i<=rolls; i++) {
int random;
Random randomNumbers = new Random();
random = 1 + randomNumbers.nextInt(6);
System.out.printf("The random number selected is: " + random + ".\n");
}
System.out.println("Do you wish to continue, Yes or No?");
Scanner sc = new Scanner(System.in);
answer = sc.nextLine();
}
}

}