Sorting an integer array using heap sort
Why do you need to pass the length of an array to buildMaxHeap?

private static void buildMaxHeap(int[] arr, int len) {


The functions itself can just use find the length property itself because it is getting the actual array from function parameters.

However, I still believe that it was smart idea to check that i was less than len, which was the length of the array rather than just checking if i was less than the length the array because it is unnecessarily efficient to constantly access the length property of an array.

Here is what I mean:

private static void buildMaxHeap(int[] arr) {
    // any nodes after n/2 are leaves node and could be without children
    int len = arr.length;
    for (int i = (len) / 2; i &gt;= 0; i--) {
        // bubble up to build max heap
        bubbleUp(arr, i, len - 1);
    }
}




All of your functions (except main) are very cluttered up with comments. I recommend that you add JavaDoc to all these functions and include as much explanation as you need up there.

That way, if there any confusions about something in a function, the answer can be found above the function, rather than in the function.



This line of heapSort

System.out.println("Sorted Array : " + Arrays.toString(arr));


is confusing in two ways:


You are printing the same message in main so I don't see why you are doing it again here.
This method is for "heap-sorting" an array, not for sending output to the user. If possible, all input and output should be done inside main.




Note: This may not apply, but you didn't include the class definition so I do not know.

I recommend calling this class HeapSort, and then having a single static public method called sort that takes a single array and "heap-sorts" it. 

That way, if you are writing other code that needs to "heap-sort" an array, you can use the HeapSort class and call it's sort method to sort it. This will make your code more organized.

Here is what I mean:

public class HeapSort {
    public static void sort(int[] arr) {
        [heapSort code]
    }

    ... your other private methods...
}


Now your code is more organized and is ready to be used by another class.

Here is how you would use the HeapSort class and it's sort method:

HeapSort.sort(myIntArray);