Hello eric and welcome to the Java Programming Forums.

You can use this code below. I have used the Scanner class to take user input from the console.
This will then set the size of the array...