Answer the question
In order to leave comments, you need to log in
How to pass an object of an unknown type to a method?
We have an interface:
public interface Sorter {
void sort(Integer[] array);
}
public class BubbleSort implements Sorter{...}
public class MergeSort implements Sorter{...}
public class QuickSort implements Sorter {...}
public class ShellSort implements Sorter{...}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question