import java.util.ArrayList; class ToDos { public static void main(String[] args) { // Sherlock ArrayList<String> sherlocksToDos = new ArrayList<String>(); sherlocksToDos.add("visit the crime scene"); sherlocksToDos.add("play violin"); sherlocksToDos.add("interview suspects"); sherlocksToDos.add("listen to Dr. Watson for amusement"); sherlocksToDos.add("solve the case"); sherlocksToDos.add("apprehend the criminal"); sherlocksToDos.remove("visit the crime scene"); // Calculate to-dos until case is solved: System.out.println(sherlocksToDos.indexOf("solve the case")); // Change the value printed: System.out.println("PRINT THE ANSWER HERE"); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter