Go through each process. timesPrintedInLinefirst 0, so in Print()it will print a new line. When timesPrintedInLineequal to 1, 1 is not a multiple of 5, therefore it System.out.printwill print char, returned from correctChar()to Print(); because 1 / (1 * 4) is not equal to 1, it Bis printed. The same thing happens for 2 and 3.
timesPrintedInLine 4, correctChar(); A.
timesPrintedInLine 5, , linesPrinted 5/4 1.
timesPrintedInLine= 6 7, A 6/4 7/4 1.
timesPrintedInLine 7. timesPrintedInLine/(1 * 4) 1, B ( , timesPrintedInLine 5, , linesPrinted timesPrintedInLine/4).
if, :
if(timesPrintedinLine/(consecLines*5) % 2 == 0)