Queue implementation using array in java