how to use for loop in java