LoginSignup
1
2

More than 5 years have passed since last update.

OpenJDKでPairを使う

Posted at

Abstract: You can instantiate java.util.AbstractMap.SimpleEntry instead of javafx.util.Pair, even in OpenJDK or Java7 (or lesser).


  • 競技プログラミングではときどきキーと値の組、すなわちペアを使いたいことがある。
  • スクリプト言語では配列に複数の型の値を入れられる。
  • C++ではstd::pair、C#ではSystem.Collections.Generic.KeyValuePairSystem.Tuple、CrystalではTupleといったように、コンパイル言語ではペアのサポートがある。
  • 一方、Javaにはペアのサポートがない。
  • Java8にはjavafx.util.Pairというクラスが導入されたが、OpenJDKには導入されていない。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2