KMP算法的Java实现publicclassKMP{publicstaticint[]next;staticvoidGetNext(Stringp,intnext[]){intpLen=p.length();next[0]=-1;