+ 1
Why I am getting error in this code
3 Antworten
+ 3
Here you're calling the static method reverseOrder of the Collections class and it returns a Comparator. You're not calling a constructor. So there is no need to instantiate a new comparator as it is handled by the method.
https://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#reverseOrder()
+ 1
Why we don't use new keyword at comparator
0
Remove the 'new' keyword from the Comparator line 9.