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.
13 lines
558 B
13 lines
558 B
public class Fanxingtest {
|
|
public static void main(String[] args) {
|
|
Fanxing<Integer, String> fanxing = new Fanxing<>(888, "Fanxingtest");
|
|
System.out.println("原始Pair:");
|
|
System.out.println("Key: " + fanxing.getKey());
|
|
System.out.println("Value: " + fanxing.getValue());
|
|
|
|
Fanxing<String, Integer> swapped = Fanxing.swap(fanxing);
|
|
System.out.println("\n交换后的Pair:");
|
|
System.out.println("Key: " + swapped.getKey());
|
|
System.out.println("Value: " + swapped.getValue());
|
|
}
|
|
}
|