you can create a class with methods that get an array as a parameter, sort it and return a new sorted array or just the original one.
class Sort {
public void MergeSort(Object array[]) {
// orders the array
}
public void SelectionSort(Object array[]) {
// orders...
}
}
with these methods you can order any kind of array (but the object contained should implements the Comparable interface).
if you need the algorithm for MergeSort etc you can do a web search. you may find these algorithms in another language but you shouldn't find it hard to translate them in Java :-)