摘要: PriorityQueue<Integer> heap = new PriorityQueue<>(); // 基本操作 heap.add(1); heap.poll(); heap.peek(); heap.clear(); heap.contains(1); heap.size(); // 默认 阅读全文
posted @ 2023-03-03 22:08 zhongyu_127 阅读(32) 评论(0) 推荐(0)
摘要: 八股 StringBuilder与StringBuffer的公共父类是AbstractStringBuilder,提供了很多操作修改字符串的方法。 StringBuilder非线程安全,StringBuffer使用synchronized给方法加了同步锁保证线程安全。 字符串的“+”是通过Strin 阅读全文
posted @ 2023-03-01 21:02 zhongyu_127 阅读(67) 评论(0) 推荐(0)