In my computer science course I was told that only literals and named constants can be used to create an array, like
int[] myarray = new int[10];