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.

16 lines
580 B

package com.homework;
public class TestMain {
public static void main(String[] args) {
Pair<String, Integer> pair = new Pair<>("年龄", 20);
System.out.println("交换前:" + pair);
pair.swap();
System.out.println("交换后:" + pair);
Cache<String, String> cache = new Cache<>();
cache.put("name", "张三");
cache.put("id", "20260001");
System.out.println("缓存获取name:" + cache.get("name"));
System.out.println("缓存是否包含id:" + cache.containsKey("id"));
}
}