There is no Pair in the standard framework, but the Apache Commons Lang, which comes quite close to “standard”, has a Pair.
new MutablePair<>(1, "xxx");
new ImmutablePair<>(1, "xxx");
More Related Contents:
- How to get a result of a function from another function?
- Call a method with parameters in java
- How do I correctly implement this code segment without getting a logic error? [closed]
- Stack algorithm is not working pefectly in Java
- How to use the toString method in Java?
- Concatenating null strings in Java [duplicate]
- Spring RestTemplate – how to enable full debugging/logging of requests/responses?
- POSTing a @OneToMany sub-resource association in Spring Data REST
- Converting an array of objects to an array of their primitive types
- Convert String to Calendar Object in Java
- Copy all values from fields in one class to another through reflection
- Why doesn’t a missing annotation cause a ClassNotFoundException at runtime?
- Last row always removed from DefaultTableModel, regardless of index
- Why does this subtraction not equal zero?
- How to programmatically inject a Java CDI managed bean into a local variable in a (static) method
- Add multiple items to an already initialized arraylist in Java
- Can we read the OS environment variables in Java?
- How do you debug Java Applets?
- Android coding with switch (String)
- Java Enums, JPA and Postgres enums – How do I make them work together?
- How to define a JUnit method rule in a test suite?
- Maven build failed: “Unable to locate the Javac Compiler in: jre or jdk issue”
- Is it possible to use sun.misc.Unsafe to call C functions without JNI?
- How to get the enum type by its attribute?
- HQL joined query to eager fetch a large number of relationships
- Clarifying terminology – What does “hydrating” a JPA or Hibernate entity mean when fetching the entity from the DB
- When do I need to call this method Runtime.getRuntime().addShutdownHook()
- Java Scanner class reading strings
- How to create a notification in swing
- What is the meaning of “ReentrantLock” in Java?