I can't figure out why I am getting this runtime error. Java is telling me that line 17 is the issue.
import java.util.Scanner;
public class whatIsWrong {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int size = 0;
        String[] names;
        names = new String[size];
        System.out.printf("%nEnter number of names desired names:  ");
        size = input.nextInt();
        for(int i = 0; i < size; i++) {
           System.out.printf("%nName #%d:  ", i +1);
           names[i] = input.nextLine();
        }
    }
}
 
     
     
    