Java with for loop