Back
I want to have a tuple structure with the below Hashtable:
Hashtable<Long, Tuple<Set<Long>,Set<Long>>> table = ...
Can anyone tell me how to do it?
Java doesn’t have a separate tuple class. You can implement one like below:
public class Tuple<X, Y> { public final X x; public final Y y; public Tuple(X x, Y y) { this.x = x; this.y = y; } }
public class Tuple<X, Y> {
public final X x;
public final Y y;
public Tuple(X x, Y y) {
this.x = x;
this.y = y;
}
Interested in Java? Check out this Java Certification by Intellipaat.
31k questions
32.8k answers
501 comments
693 users