2021年2月8日

java-ArrayList,LinkedList

摘要: 1.ArrayList ArrayList<String> sites = new ArrayList<String>();//创建sites.add("Weibo"); //添加sites.add(1,"jjj"); //在索引1处插入System.out.println(sites);sites 阅读全文

posted @ 2021-02-08 15:44 大鱼与小鱼 阅读(55) 评论(0) 推荐(0)

java-栈stack,队列queue,双端队列deque

摘要: 1.Stack继承于Vector,通过数组实现 (不要用啦!淘汰啦!) Stack<Integer> st = new Stack<Integer>();System.out.println("stack: " + st); //输出st.push(a); //压栈Integer a = (Inte 阅读全文

posted @ 2021-02-08 14:18 大鱼与小鱼 阅读(125) 评论(0) 推荐(0)

HashSet使用小结

摘要: HashSet 基于 HashMap 来实现的,是一个不允许有重复元素的集合。 HashSet 允许有 null 值。 HashSet 是无序的,即不会记录插入的顺序。 HashSet 不是线程安全的, 如果多个线程尝试同时修改 HashSet,则最终结果是不确定的。 您必须在多线程访问时显式同步对 阅读全文

posted @ 2021-02-08 12:02 大鱼与小鱼 阅读(57) 评论(0) 推荐(0)

HashMap使用小结

摘要: 1. HashMap 基本用法 增 — map.put("4", "c"); 删 — map.remove("4"); 改 — map.put("4", "d");//覆盖 查 — res.get('a'); //查找对应键值 map.containsKey("2"); //boolean map. 阅读全文

posted @ 2021-02-08 11:16 大鱼与小鱼 阅读(65) 评论(0) 推荐(0)

导航