摘要: 示例代码如下: 1 public class HashMapBianLiTest { 2 public static void main(String[] args) { 3 // hashMap的遍历 4 HashMap hashMap = new HashMap(); 5 hashMap.put 阅读全文
posted @ 2023-01-01 21:57 zwGitOne 阅读(69) 评论(0) 推荐(0)
摘要: Set接口实现类主要是:HashSet,LinkedHashSet【二者,可以看看java集合.xmind文件】,TreeSet【没有学到】 一. HashSet类的遍历: 1 public class SetBianLiTest { 2 public static void main(String 阅读全文
posted @ 2023-01-01 21:24 zwGitOne 阅读(103) 评论(0) 推荐(0)
摘要: List接口实现类主要有:ArrayList,LinkedList,Vector【三者区别,可以看看java集合.xmind文件】 一. ArrayList类的遍历: 1 public class ListBianLiTest { 2 public static void main(String[] 阅读全文
posted @ 2023-01-01 20:46 zwGitOne 阅读(164) 评论(0) 推荐(0)
摘要: 示例代码如下: public class VectorTest { public static void main(String[] args) { List list = new Vector();// 接口的多态 for(int i = 0;i<10;i++){ list.add(i); } f 阅读全文
posted @ 2023-01-01 13:32 zwGitOne 阅读(126) 评论(0) 推荐(0)
摘要: 一. 介绍LinkedList类 阐明LinkedList类的成员: 其本质是双向链表,first指向链表的头部,last指向链表的尾部。 二. 介绍LinkedList静态内部类Node类 阐明Node类的成员: 三. 创建LinkedList对象 调用无参构造器,创建一个空链表 四. 解析add 阅读全文
posted @ 2023-01-01 11:23 zwGitOne 阅读(264) 评论(0) 推荐(0)
摘要: 使用无参构造器创建的ArrayList对象,示例代码如下: public class ArrayListTest { public static void main(String[] args) { List list = new ArrayList(); // 10 for(int i = 0;i 阅读全文
posted @ 2023-01-01 10:12 zwGitOne 阅读(486) 评论(0) 推荐(0)