java 2 3
fdsa
fdsa
-
- 1 / 496
-
Cartes-fiches
Whats the static comparator-method for sorting using the order specified by the comparable implementation on the object itself?
naturalOrder()
Whats the static comparator-method for sorting using the reverse of the order specified by the Comparable implementation on the object itself?
reverseOrder()
Whats the default-method in comparator for reversing the order of the chained comparator?
reversed()
Whats the default-method in comparator if the previous comparator returns 0 se this comparator that returns a double/int/long , otherwise return the value form the previous comparator
thenComparingDouble(function) / thenComparingInt(function) / thenComparingLong(function)
When can we use Collections.sort()?
When the objects to be sorted are Comparable
What are the preconditions for Collections.binarySearch?
Must be sorted
What cant be done with genericTypes?
- calling a constructor
- creating an array of that generic type
- calling instanceof
- using a primitive type as a generic type parameter
- creating a static variable as a generic type parameter
What happns if you add list.removeIf on a list which was created by list.of()?
unsupportedOperation