`this has been bugging me .giving me error.....can anyone tell me how to solve that: exception in thread "main" StringIndexOutOfBoundsException: String index out of range: 8'
   public class Solution {
   public static boolean checkit(String input){
       int i,j;
       boolean s=false;
       for(i=0;i<=input.length()-3;i++){
           for(j=i+2;j<=input.length()-1;j++)
           {
               if(input.charAt(i)==input.charAt(j+1) && input.charAt(i+1)==input.charAt(j))
                   s=true;
           }
       }
     return s;  
   }
   public static void main(String [] args){
       System.out.print(checkit("ABcBAxxs"));
}
}
 
     
    