How to create array of objects in Java