For Loop Pattern In Java