Can you explain the operation of this override?

private static class Pair{

    int x,y;
    public Pair(){
        this.x=0;
        this.y=0;
    }
}

static void sortPair(Pair a[]){
    Arrays.sort(a,new Comparator<Pair>(){
        @Override public int compare(Pair p1,Pair p2){
            return p1.x-p2.x;
        }
    });
}

This means that while using the sort function over this array of pairs, the default comparator function( which is used by the sort function to compare two elements for which is greater) will be overridden with the implementation provided.