I want to allow the user to input a number which will be the number of Strings (choices). The program will then generate a random number that is between 0 and the lenth of the array and display the element that matches the idex of the random number. However whenever I run the program the output simply says "null". I've attached my code. Any advice will help, thanks.
import java.util.Scanner;
import java.util.Arrays;
public class Decision{
public static void main (String[] args){
Scanner I= new Scanner(System.in);
System.out.println("How many choices would you like to choose from?");
int i=I.nextInt();
System.out.println("Enter the " + i + " choices:");
Scanner C= new Scanner(System.in);
String c= C.nextLine();
String[] options=new String[i];
int random = (int)(Math.random() * i +1);
String choice = options[random];
System.out.println(choice);
}
}