Insertion sort algorithm in Java I have tested this code and it yields the expected outputs, but I want to verify if I have applied insertion sort algorithm correctly or not.

 import java.util.*;
public class InsertionSort 
{
    static void swap(int[] arr, int i, int j)
    {
        int temp = arr[i]; 
        arr[i] = arr[j]; 
        arr[j] = temp; 
    }

    static void sorter(int arr[])
    {

        int hole; 
        int n = arr.length; 
        if(n&gt;=2)
        {
            for(int i = 1; i&lt;n ; i++)
            { 
                hole = i;
                inner:
                for(int j = i-1; j&gt;=0; j--)
                {
                    if(arr[j]&gt; arr[hole])
                    {
                        swap(arr, j, hole);
                        hole = j; 
                    }
                    else
                        break inner; 
                }
            }
        }
        System.out.println(Arrays.toString(arr));
    }
}
Labeled loops

You say 


                        break inner;



But that's not necessary.  The inner loop is already the innermost loop.  You could just say break;.  

And frankly, you could have just said 

                for (int j = i-1; j &gt;= 0 &amp;&amp; arr[j] &gt; arr[hole]; j--)


No break or internal if needed.  

But that's not the question you really wanted answered.  

Insertion sort?

It's similar to an insertion sort.  Your insertion method is a bit odd though.  Normally insertion sort would find the insertion point and then move the elements after that.  You're bubbling the current value forward.  

Consider 

int j = i - 1;
while (j &gt;= 0 &amp;&amp; numbers[j] &lt; numbers[i]) {
    j--;
}

int temp = numbers[i];
for (int k = i; k &gt; j; k--) {
    numbers[k] = numbers[k - 1];
}

numbers[j] = temp;


That does about half as many array assignments as your method.  

Naming

I prefer a descriptive name like numbers to a generic abbreviation like arr.  At minimum, it should be array.  But I prefer numbers.  


    static void sorter(int arr[])



As a general rule, we name classes and objects with noun names.  Methods get verb names.  So 

    static void sort(int[] numbers) {


In Java, we also normally write arrays as int[] name not int name[].  

You could name the class 

class InsertionSorter {


Although in this case InsertionSort can be used as a noun.  

Wildcard imports

import java.util.*;


The general policy is to import one class at a time, not a wildcard group.  That's especially true here, since it's not clear that you are using any java.util classes.  

Mixing logic and display

It's generally agreed that it is better to return the data and display it separately.  Since you are sorting in place, that could just look like 

InsertionSort.sort(numbers);
System.out.println(Arrays.toString(numbers));


Declare at initialization

You have 


                hole = i;



You could do 

                int hole = i;


It's generally considered best practice to declare variables as late as possible.  You don't use hole outside the loop or across iterations, so there's no need to declare it outside the loop.  

Redundant logic


        if(n&gt;=2)
        {
            for(int i = 1; i&lt;n ; i++)



If n is 1 or less then 1 &lt; n will be false and it won't enter the loop.  

And you don't need n.  You can just say numbers.length whenever you need that value.  

Standard methods

You could also replace these two loops with Java standard methods.  

        int insertionPoint = Arrays.binarySearch(numbers, 0, i, numbers[i]);
        if (insertionPoint &lt; 0) {
            insertionPoint = -insertionPoint - 1;
        }

        int temp = numbers[i];
        System.arraycopy(numbers, insertionPoint, numbers, insertionPoint + 1, i - insertionPoint);
        numbers[insertionPoint] = temp;


Of course, it's possible that you were trying to avoid standard methods.  After all, Arrays.sort would solve this problem without additional coding.