Problem of the Day
Wednesday, December 17, 2025
Problem:
During the Jewish festival Hannukah, the dreidel game is played with a small, four-sided, spinning top. Each of the four faces is imprinted with a Hebrew letter, and when the top is spun, one of the four letters will land face up. Hebrew letters can be displayed in a webpage by using a numeric character reference according to the table here.
| Letter Name | Hebrew Letter | HTML reference |
| "Nun" | נ | נ |
| "Gimel" | ג | ג |
| "He" | ה | ה |
| "Shin" | ש | ש |
What does the method r given here do?
public static String r()
{
String[] let = {"Nun", "Gimel", "He", "Shin"};
return let[(int) (Math.random() * let.length)];
}
- Identifies the HTML code for a given LetterName
- Identifies the HTML code for a given Hebrew letter
- selects a random Hebrew letter
- selects a random HTML reference for a Hebrew letter
The correct answer is c. The list of legal letters in the array let is established, and then a random index is created, and the letter at that index position returned.