Given the program below, what is the output if the user enters “one” in response to the prompt?
/************************************************************** FantasyFootball.java* Dean&Dean** This prints out names of football players.*************************************************************/import java.util.Scanner;import java.util.ArrayList;public class FantasyFootball{ public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); ArrayList<String> players = new ArrayList<>(); String indexStr; int index = 0; players.add("Aaron Rodgers"); players.add("Ray Rice"); players.add("Andrew Luck"); System.out.print("Enter a number between 1 and 3: "); indexStr = stdIn.nextLine(); try { index = Integer.parseInt(indexStr); System.out.println("Entered index OK."); } catch (NumberFormatException e) { System.out.println("Entered index wasn’t an integer"); } try { System.out.println(players.get(index - 1)); } catch (IndexOutOfBoundsException e) { System.out.println( "Can’t access players[" + (index - 1) + "]"); } System.out.println("done"); } // end main} // end class FantasyFootball
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.