title: Find largest digit palindrome - ArrayIndexOutOfBoundsException?
body: <p>I am trying to solve a problem based on palindrome.<br>
  But all I keep getting is this exception - <code>ArrayIndexOutOfBoundsException</code></p>
  
  <p>I really wanted to figure it out myself, but I'm not able to understand the cause. </p>
  
  <p>Here's the code:</p>
  
  <pre><code>public class LargestPalindrome
  {
      public int isPalindrome(int n)
      {
          int revNum=0;
          int num=n,flag=0;
          while(num!=0)
          {
              revNum=revNum*10;
              revNum=revNum + (num%10);
              num=num/10;
          }
  
          if(n==revNum)
              flag=1;
          else
              flag=0;
          return(flag);
      }
  
      public static void main(String args[])
      {
          LargestPalindrome p=new LargestPalindrome();
          int flag=0,pro=0;
          int a[]= new int[100];
          int b[]=new int[100];
  
          for(int i=1;i&lt;=99;i++)
          {
              a[i]=i;
              b[i]=i;
          }
  
          for(int i=1;i&lt;=99;i++)
          {
              for(int j=1;j&lt;=99;i++)
              {
                  pro=a[i]*b[j];
  
                  flag=p.isPalindrome(pro);
                  if(flag==1)
                      System.out.println(pro);
                  pro=0;
              }
          }
  
      }
  }
  </code></pre>
  
  <p><strong><em>Any suggestions?</em></strong></p>