I declared a string array of 5 phrases. Im having trouble with printing out only one phrase randomly out of the array. My code below generates several phrases. How do I only print out one?
int length = arr.length;
for (int i = 0; i < length; i++)
{
int rand = (int) (Math.random() * length);
System.out.println(arr[rand]);
}
forloop? Isarrthe array of phrases?