search

Home  >  Q&A  >  body text

为什么 Java 没有 Pair

你看 C++ stl 都有 std::pair
android 还写了 android.util.Pair

PHP中文网PHP中文网2767 days ago797

reply all(3)I'll reply

  • 怪我咯

    怪我咯2017-04-17 11:50:29

    You can look at Entry<K,V>, which is actually similar to pair

    reply
    0
  • 阿神

    阿神2017-04-17 11:50:29

    std::pair acts as an element in std::map

    Map.Entry also acts as an element in Map

    This is the general idea

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 11:50:29

    Google’s Guava summarizes it well: Tuples for n >= 2

    reply
    0
  • Cancelreply