If the pattern is present at the current shift , then index j will become - 1 after the above loop
if ( j < 0 ) { System . out . printf ( "pattern occurs at shift = %dNEW_LINE", s); s += shift [ 0 ] ; } else