How to declare a dynamic array in Java