java looping by var start value & end value