One question about code-design in java:
You have a sorting algorithm (it doesn't matter which one) that sorts specific custom Objects upon specific keys they have. To get a practical example: You have a "Record" class that contains the name of a person, their ID number and their age. Now you *can* have in the class a static fourth variable (SortKeyField) that determines which of these 3 is used as "key" to sort the objects with.
Now your job is to sort these objects. The search algorithm only knows that all objects it shall sort have a method called "less" that allows the comparison of 2 ke…