摘要:
Collection的子接口之Set接口 Set包含 HashSet:作为Set接口的实现类;线程不安全;可以存储null值 LinkedHashSet:作为HashSet的子类;遍历内部数据时,可以按照添加的顺序遍历 TreeSet:可以按照添加对象的指定属性,进行排序 Set接口的特点 无序性: 阅读全文
posted @ 2021-07-03 22:28
yicurtain
阅读(67)
评论(0)
推荐(0)
摘要:
Collection的子接口之List接口 ArrayList、LinkedList和Vector三者之间的异同? 相同点:三个类都实现了List接口,存储数据的特点相同:存储有序的、可重复的数据。 不同点: ArrayList:作为List接口的主要实现类,线程不安全,效率高;底层使用Object 阅读全文
posted @ 2021-07-03 21:41
yicurtain
阅读(43)
评论(0)
推荐(0)
摘要:
集合之Collection接口 Collection接口中方法的使用 添加 add(Object obj) addAll(Collection coll) 获取有效元素的个数 int size() 清空集合 void clear() 是否是空集合 boolean isEmpty( 阅读全文
posted @ 2021-07-03 21:39
yicurtain
阅读(36)
评论(0)
推荐(0)
浙公网安备 33010602011771号