4 ms·
In Java, the primitive type double uses the IEEE-754 semantics and java.lang.Double uses the bits by bits comparison semantics [1] so List<Double>.remove() work
by _old_dude_ 4y ago
In Java, the primitive type double uses the IEEE-754 semantics and java.lang.Double uses the bits by bits comparison semantics [1] so List<Double>.remove() works correctly.
[1] https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/lang/Double.html https://docs.oracle.com/en/java/javase/19/docs/api/java.base...
- uluyol 4y agoThis won't help you in a future version of Java where you can write List<double>, right?
- masklinn 4y agoNo. What will help you is that `clear()` is part of `Java.until.Collection` so just about every container has it.
- _old_dude_ 4y agoIt depends if List<double> is an alias for List<@PleaseSpecialize @NotNull Double> or not.