What if the scjp question has sorting for these both?Is it a runtime exception?
posted 5 years ago
That is a good exam tricky question. Collects.sort(...) can be used to sort a list. The parameter of the sort() methods is a List<T> , not any other type. I tried to pass a hashset to Collections.sort(), but it won't compile.