上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要: 1.特性 1.1 无序性:不等于随机性,存储的数据再底层数组中并非按照索引存放,而是按照哈希值 1.2 不可重复性:保证添加的元素按照equals 判断时不能返回true 2 HashSet LinkedList TreeSet 2.1 2.2 LinkedList 也是无序的,能够按照添加的顺序便 阅读全文
posted @ 2022-04-09 20:09 写代码的小哥哥 阅读(48) 评论(0) 推荐(0)
摘要: 1.三者区别 1.1 List 存储有序的,可重复的数据1.2 ArrayList 线程不安全效率高,底层使用 Object[] elementData1.3 LinkedList 频繁的插入,删除使用此类效率比ArrayList 高,底层使用双向链表1.4 Vector 线程安全,效率不高 底层使 阅读全文
posted @ 2022-04-09 17:33 写代码的小哥哥 阅读(24) 评论(0) 推荐(0)
摘要: 1. == 1.1 基本数据类型比较值 1.2 引用数据类型比较引用地址 public class EqualsTest { public static void main(String[] args) { Person tom = new Person(1, "Tom"); Person tom1 阅读全文
posted @ 2022-04-06 17:14 写代码的小哥哥 阅读(30) 评论(0) 推荐(0)
摘要: 1.接口情况 阅读全文
posted @ 2022-04-06 16:59 写代码的小哥哥 阅读(22) 评论(0) 推荐(0)
摘要: package com.cj.java1; import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; class 阅读全文
posted @ 2022-04-02 22:14 写代码的小哥哥 阅读(22) 评论(0) 推荐(0)
摘要: package com.cj.java1; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.FutureTask; // 阅读全文
posted @ 2022-04-02 21:53 写代码的小哥哥 阅读(58) 评论(0) 推荐(0)
摘要: package com.cj.java1; class Producer extends Thread{ private Clerk clerk; public Producer(Clerk clerk){ this.clerk = clerk; } @Override public void ru 阅读全文
posted @ 2022-04-02 21:43 写代码的小哥哥 阅读(28) 评论(0) 推荐(0)
摘要: package com.cj.java1; import java.util.concurrent.locks.ReentrantLock; class Number implements Runnable{ private int number = 1; private ReentrantLock 阅读全文
posted @ 2022-04-02 20:53 写代码的小哥哥 阅读(22) 评论(0) 推荐(0)
摘要: package com.cj; import java.util.concurrent.locks.ReentrantLock; public class LockTest implements Runnable{ private static int ticket = 100; private R 阅读全文
posted @ 2022-04-02 17:59 写代码的小哥哥 阅读(101) 评论(0) 推荐(0)
摘要: package com.cj; class Book { private Book(){} private static Book instance = null; public static Book getInstance() { if(instance==null){ //同步代码块 sync 阅读全文
posted @ 2022-04-02 17:38 写代码的小哥哥 阅读(26) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 下一页