Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

pair in java generics

843793Feb 2 2007 — edited Nov 15 2008
Perhaps I have missed something, but as far as I can tell, there is no pair template in the generic data structure classes provided with the jdk

C++ has pair<T1, T2> which is quite useful. The closest java type I can find is Map.Entry, but of course, you can't construct one of these.

Is there a generic Pair class for java that I have somehow overlooked? If not, why has such a basic generic type been excluded from the library?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 13 2008
Added on Feb 2 2007
14 comments
453 views