Word ladder solution in Java using matrix
package arrays;


Wrong, unless it's your name and you've registered the top-level domain arrays. Seriously, use a personal package prefix, even for toy code.

import java.util.Hashtable;


Hashtable still exists? :D Forget it, and use HashMap (it's about the same, but not synchronized and much more in use).

Hashtable&lt;Integer, String&gt; dict = new Hashtable&lt;Integer, String&gt;();
dict.put(1, source);
dict.put(2, "hot");


That's what arrays are good for, you need no map here.

java.util.Arrays.fill(row, 99999);


Feel free to import it. Is 99999 enough? Sure, but the classical choice is Integer.MAX_VALUE. But this may lead to overflow, so sticking with a smaller constant is fine. Just declare the constant as

private final int VERY_FAR = 99999;


so that your code is not filled with essentially random numbers.

for (int i = 0; i &lt; keySet.size() - 1; i++) {
    String mainString = dict.get(i + 1);
        for (int j = i + 2; j &lt;= dict.size(); j++) {


You shouldn't have started the numbering with 1. Now there's i, i+1, i+2, pretty confusing. Actually, you shouldn't numbered the words at all, simply

List&lt;String&gt; dict = Arrays.asList(
    new String[]{"hot","dot","dog","lot","log"});


would do. Actually, you could stick with an array like

String[] dict = {"hot","dot","dog","lot","log"};


but lists are nearly always preferred.

You're computing the hamming distance of all word pairs. Google says


  The number of words in the English language is: 1,025,109.8.


which means some 1e12 pairs. You'd need a pretty smart algorithm to avoid this pairing, so let's forget it for now.

However, the problem is that you compute all the distances, while


you don't really need them
they don't really help


You don't need the distance, all you need is to know if two words are neighbors (i.e., a boolean instead of an int). But actually, the question is not "given two words, determine their distance", but "starting with dog, where can I go?". So what you need is something like

Map&lt;String, Set&lt;String&gt;&gt; neighbors;


and then a path-finding algorithm (which actually could make use of knowing the distance, but that's a different story).

if(mainString.length()!=str.length()) throw new Exception();


That's too brutal. Mathematically, returning infinity would be perfect. Returning some big number would be fine. Throwing an IllegalArgumentException or some exception of your would be fine, too.

However, it's good that you think about it. Doing nothing would be too bad (distance("hot", "hotdog") would be zero).