I'm trying to go through an array of strings and print one index at a time, but when I tried running the program all I get is a 0 or 1. I'm not really sure how to fix this. Below is what I have so far.
So when I call on the method I've created for this, I would like to call "Turnip" and when I call it again I get "Little Old Lady". I'm not really sure how to go about doing this, but if someone could try and fix my code I would be very thankful.
String[] clues = { "Turnip", "Little Old Lady", "Atch", "Who", "Who" };
int currentJoke = 0;
//while (name.equalsIgnoreCase("yes")) {
String temp = clues[0];
for (int i = 0; i < clues.length - 1; i++) {
clues[i] = clues[i + 1];
}
clues[clues.length - 1] = temp;
out.println(currentJoke++);
//}