Queue Implementation in Java with basic array