Transform String a into b
int[][] mat = new int[n + 1][m + 1];
        for(int i = 0 ; i &lt; n + 1 ; i++)
            mat[i][0] = 0;
        for(int i = 0 ; i &lt; m + 1 ; i++)
            mat[0][i] = 0;



Consider 

        int[][] mat = new int[n + 1][m + 1];
        Arrays.fill(mat[0], 0);
        for (int i = 1; i &lt; mat.length; i++) mat[i][0] = 0;


Now we no longer initialize mat[0][0] twice.  We initialize it only once because we exclude it from the for loop.  

We use the built-in to initialize the first row.  

We initialize the rest of the first column with a for loop, as the built-in doesn't work with columns.  

Since we are using the single statement version of the for loop, we put the single statement on the same line as the for loop.  Now it's obvious that it's just a single statement.  Before it was less obvious.  

I would actually prefer to always use the block form, but that's your choice.  

I changed from n + 1 to mat.length because it is more robust in the face of future changes.  Consider what happens if you were to change the n + 1 in the first line to n + 2.  In the original code, you would have to change the second line as well.  In this version, you don't.  

One might argue that you would never change the 1 to a 2 in this code.  But even if that is so here, that might not be true in other code.  It is a good habit to try to avoid having code parallel other code.  If possible, make the code follow the other as it does here.  The mat.length will always be the right value here while the n + 1 is dependent on the logic used now.  

I'm not crazy about the name mat.  I'm guessing it's short for matrix, but matrix of what?  It seems like there could be a more descriptive name.  

Note that given the way that Java defaults integer values, the initialization is actually unnecessary.  Java will initialize the whole thing to 0.  You don't have to do any explicit initialization.  Java will do what you want automatically.  


        char capStart = 65;
        char capEnd = 90;
        char smallStart = 97;
        char smallEnd = 122;
        char diff = 32;



You only use two of these 

        char smallStart = 'a';
        char diff = 'A' - 'a';


I find this more readable.  By substituting 'a' for the numeric value, it is clearer about what we seek.  Although I'd probably just change 


                if(a[i - 1] &gt;= smallStart)



to 

                if (a[i - 1] &gt;= 'a')


or 

                if (Character.isLowerCase(a[i - 1]))


That last may be longer, but it is also more robust against other alphabets than the latin1 alphabet.  And it may be better optimized as well.  


        for(int i = 1 ; i &lt; n + 1 ; i++)
        {
            for(int j = 1 ; j &lt; m + 1 ; j++)



Given the frequency with which you say i - 1 and j - 1, I'd consider saying 

        for (int i = 0; i &lt; a.length; i++)
        {
            for (int j = 0; j &lt; b.length; j++)


I believe that this reads more naturally.  For each letter in a and for each letter in b, do...  

Don't forget to change all the i - 1 to i and all the i to i + 1 if you do this.