How to use Single Dimensional Array in Java