Abstract: You can instantiate java.util.AbstractMap.SimpleEntry
instead of javafx.util.Pair
, even in OpenJDK or Java7 (or lesser).
--Sometimes you want to use key / value pairs, or pairs, in competitive programming.
--The scripting language allows you to put multiple types of values in an array.
--There is support for pairs in compilation languages, such as std :: pair
in C ++, System.Collections.Generic.KeyValuePair
and System.Tuple
in C #, and Tuple
in Crystal.
--On the other hand, Java does not have pair support.
--A class called javafx.util.Pair was introduced in Java8, but not in OpenJDK.
--Aside: In yukicoder, my answer was once AC, but it became CE because Sun Java was changed to OpenJDK.
--There is java.util.Map.Entry
with the same interface, but this cannot be instantiated.
--When I investigated this, I found that I should use the class java.util.AbstractMap.SimpleEntry
.
Recommended Posts