1、序列化时候:对象对应的类要实现Serializable即:implements Serializable
2、获取当前时间即转成中文形式:
SimpleDateFormat sdf=new SimpleDateFormat("yyyy年MM月dd HH:mm:ss");
this.time=sdf.format(new Date());
3、判断集合中是否包含一个键的方法
if(map.containsKey(id)){
map.remove(id); //删除键值对
}
1、序列化时候:对象对应的类要实现Serializable即:implements Serializable
2、获取当前时间即转成中文形式:
SimpleDateFormat sdf=new SimpleDateFormat("yyyy年MM月dd HH:mm:ss");
this.time=sdf.format(new Date());
3、判断集合中是否包含一个键的方法
if(map.containsKey(id)){
map.remove(id); //删除键值对
}