how to add elements to an empty array in java