You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
373 B

public class Test {
public static void main(String[] args) {
Pair<Integer,String> pair=new Pair<>(1,"a");
System.out.println(pair.getKey());
System.out.println(pair.getValue());
Pair<String,Integer> swappedPair=Pair.swap(pair);
System.out.println(swappedPair.getKey());
System.out.println(swappedPair.getValue());
}
}