Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9018965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:39:49+00:00 2026-06-16T04:39:49+00:00

I wonder why Java doesn’t have a tuple data structure implementation in its standard

  • 0

I wonder why Java doesn’t have a tuple data structure implementation in its standard library. For instance C++ has a very good implementation of this fixed-size collection of heterogeneous values. The same in Haskell. In Java I only know javatuples and some support in Functional Java library via Product (P1 - P8) types. I wonder why tuple or at least pair not in standard library at all? Even Android SDK developers added their own implementation of 2-tuple (pair).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:39:50+00:00Added an answer on June 16, 2026 at 4:39 am

    The “Java way” is to define use-specific classes rather than these sorts of lightweight semi-class types. If you think about it, a tuple is really just a simplified struct; the Java folks would prefer you to just go ahead and create the struct.

    This perspective is changing a bit, especially in Java 8 with its lambdas (which put pressure on the JDK to provide generic Function-type interfaces rather than use-case-specific interfaces like FooCallback). But it’s still a fairly strong mindset for a lot of Java developers, and there’s some sense to it. Java is a very statically typed language; a tuple is somewhere between static typing and dynamic typing, in that there’s nothing in the type system to prevent you from thinking this (int, String) that represents a customer ID and name is actually an (int, String) representing an order ID and its description.

    See, for instance, this discussion (“Tuples for n >= 2”) on the issue within the Guava project. Granted, that’s not official; but it’s a good representation of the Java mindset.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wonder why .NET framework doesn't have pair (Observer/Observable) interfaces similar to Java's feature?
After readings How many characters can a Java String have? I started wonder wonder:
I have a Java project, which is still in a very early stage. There
I wonder why Java compiler doesn't trust in this line of code : List<Car>
I wonder why smalltalk doesn't make use of java-style inner class. This mechanism effectively
Possible Duplicate: Handling InterruptedException in Java I wonder how InterruptedException should be properly handled.
Just wonder how much cost to raise a java exception (or to call native
I wonder how is the best way to integrate Java modules developed as separate
I am debugging a java application using eclipse debugger. I wonder about the object
wonder whether someone can help me with the following one... I have a struct

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.