Lecture 7
23
for loop
•HLine paintOn() method (lines 47,48)
• for ( int i = 0; i < length; i++ ){                           s.paintAt( x+i , y, paintChar );    }
•Counts from i = 0 to i = length-1,   executing what’s in the body each time
–i=0: ask Screen s to put paintChar at (x,y)
–i=1: ask Screen s to put paintChar at (x+1,y)
–i=2: ask Screen s to put paintChar at (x+2,y)
–and so on …                                   at (x+length-1,y)