how to store input in array java