Verify that a binary tree is balanced
Naming

You did a good job with most your variable names, but not so much with your class name. Typically, you would not want ANY class name to start with a lowercase letter. The class name is also not too descriptive (what is balanced, again?). I recommend changing public class isBalanced to public class TreeBalanceChecker or public class IsBalanced if you don't heed the second part (don't forget to change the file name as well).

Secondly, what is up with haTab? Everything else was so well named, this just seems out of place. Changing it to heightTable would be more descriptive.

Permissions

What I learned is that if you don't have a modifier on your functions, and no other class is using them, add private. That's just standard Java. On the same line, if another class does need to access something, make it public. You seem to be missing a lot of those.

Constructors

There is only one constructor for TreeNode. That is not very helpful if you want to set the left and right children or parent at construction time, or you don't want to set a value. 

New code

/**
 * Definition for a binary tree node.
 */
class TreeNode {
    public int val;
    public TreeNode left;
    public TreeNode right;
    public TreeNode parent;

    public TreeNode(){
        val = 0;
    }
    public TreeNode(int x) {
        val = x;
    }
    public TreeNode(TreeNode left, int x, TreeNode right){
        this.left = left;
        this.right = right;
        val = x;
    }
    public TreeNode(TreeNode parent, TreeNode left, int x, TreeNode right){
        this.left = left;
        this.right = right;
        this.parent = parent;
        val = x;
    }

}

public class isBalanced {
    // first we will get the left height and right height of the node
    // and compute the height difference.if it is &gt; 1 we will return false
    // hashtable to maintain height of each node to reduce the no of redundant
    // height computations
    private static Hashtable&lt;TreeNode, Integer&gt; heightTable = new Hashtable&lt;&gt;();

    static int height(TreeNode root) {
        // if the node is null then it returns the height as -1
        int heightOfNode;
        if (root == null) {
            return -1;
        }
        if (heightTable.containsKey(root)) {
            return haTab.get(root);
        }
        int leftHeight, rightHeight;
        leftHeight = height(root.left);
        rightHeight = height(root.right);
        // finds the height of left subtree and right subtree and returns
        // the max of both + 1
        heightOfNode = Math.max(leftHeight, rightHeight) + 1;
        haTab.put(root, heightOfNode);
        return heightOfNode;
    }

    public static boolean isBalanced(TreeNode root) {
        if (root == null) {
            return true;
        }
        int leftHeight, rightHeight;
        leftHeight = height(root.left);
        rightHeight = height(root.right);
        // if left child and right child are balanced and the difference in
        // their heights is &lt; 2
        // then it is balanced
        if (isBalanced(root.left) &amp;&amp; isBalanced(root.right)
                &amp;&amp; Math.abs(leftHeight - rightHeight) &lt; 2) {
            return true;
        }
        return false;
    }

    public static void main(String[] args) {
        TreeNode root = new TreeNode(1);
        root.left = new TreeNode(-2);
        root.right = new TreeNode(-3);
        root.left.left = new TreeNode(1);
        root.left.right = new TreeNode(3);
        root.right.right = new TreeNode(-1);
        System.out.println(isBalanced(root));
    }
}


Additions

These are just some things to think about adding, not necessary at all


let the user create the tree with STDIN
expand TreeNode class to store height instead of the table
add a method to display the entire tree in STDOUT


Happy coding!