java - going through an array of strings and printing one and then calling the method and printing the next one -


I am trying to go through a string array and print an index at a time, but when I Trying to run the program what I got is 0 or 1. I'm not sure how to fix this. Below is what I've done so far.

So when I made this method, I would like to call "turnip" and when I call it again, "Little Old Lady". I'm not sure how to go about doing this, but if someone can try to fix my code then I would be very grateful.

  string [] leads = {"turnip", "little old lady", "etch", "hoo", "hoo"}; Init current = 0; // while (name.equalsIgnoreCase ("yes")) {string temp = clue [0]; For (int i = 0; i & lt; clues.length - 1; i ++) {clue [i] = clue [i + 1]; } Clues.length - 1] = temp; Out.println (currentJoke ++); In your program it appears that you are missing out on existing +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++ +++++++++ Current Joke ++], possibly a typo  

Once you can create a property of the cloud and print leads [clue ++] is called the function every time ...

  class clues {static intu leads = 0; Fixed string list [] = {"turnip", "little old lady", "etch", "hoo", "hoo"}; Public static zero print () (if (clue> gt; list length = 1) leads = 0; println (list [leads ++]);} public static zero main (string [] args) {for (;;) {Clues.print ();}}}  

If you want to put around a clue object or have multiple instances, you can attach them ...


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -