美文网首页
容器常用用法整理

容器常用用法整理

作者: 奥雷里亚诺下划线_上校 | 来源:发表于2018-12-16 15:03 被阅读0次

list容器
List it = new xxxList();
//增加
it.add();
//删除
it.remove(index);
//子容器
list2.subList(1,2);
//迭代器
Iterator it=ts.iterator();
if(it.hasNext()){
it.next();
}
//包含
list2.contains(2)

Set容器
Set it = new xxxSet();
类似list

Map容器
//增加.put(key,walue)
ma.put(1,1);
//删除
ma.remove(key);
//获得元素
ma.get(key)

相关文章

网友评论

      本文标题:容器常用用法整理

      本文链接:https://www.haomeiwen.com/subject/bbfxkqtx.html