Java進階-Java學習路線課程第二課:Java集合框架-HashSet的使用及去重原理

本博客地址 | GitHub | 小站坐坐 | 更多資源免費下載

        小夥伴們,大家早上好!今天我給大家帶來Java集合框架Collection之Set集合講解,今天主要講解Set集合接口下的實現類HashSet集合,今天的講解重要,請大家仔細看噢!

Java集合框架-HashSet的使用及去重原理

     前面我們已經學過了List集合(不熟悉List集合的小夥伴點擊:Java進階-Java學習路線課程第一課:Java集合框架-ArrayList和LinkedList的使用),相信大家對List集合有所瞭解了吧!List集合是有索引,有序和不唯一,那Set集合有什麼特徵呢?當然有它的特徵,沒有索引,無序和唯一。下面我們來一一講講,當然,重點會講一下HashSet去重。

文章目錄

1、首先,還是讓大家看看一個簡潔的Java集合框架結構體系圖:
2、看看這些接口和類有什麼特徵。
  • Collection(接口)

特徵(單列集合): 不唯一,無序

  • List(子接口)

特徵(單列集合): 不唯一,有序

  • Set(子接口)

特徵(單列集合): 唯一,無序

  • Map(接口)

特徵(雙列集合): 鍵值對

key --->value  map.put("userName",uName);
key是拿的Set的特性,而value是拿的Collection的特性。
  • HashSet

特徵:底層由哈希表(實際上是一個 HashMap 實例)支持。它不保證 set 的迭代順序;特別是它不保證該順序恆久不變。此類允許使用 null 元素。無索引,唯一,無序。最大的優勢就是去重。

3、先給大家演示一下HashSet去重代碼,能做到去重嗎?代碼如下:
News.java  實例類
package com.javaxyz.entity;

/**
 * @ClassName:News.java
 * @Description:新聞實例類
 * @Author:DongGaoYun
 * @AuthorEnglishName:Andy
 * @URL:www.javaxyz.com 或 www.gyun.org
 * @Email:[email protected]
 * @QQ:1050968899
 * @WeiXin:QingYunJiao
 * @WeiXinGongZhongHao: JavaForum
 * @Date:2019-10-22 下午2:23:38
 * @Version:1.0 完成以下基本代碼:  1.屬性  2.get和set方法   3.構造方法  4.toString
 * 說明
   1.這個新聞實例類沒有重寫equals和hashCode方法
   2.沒有用泛型,後面章節會介紹  
 */
public class News {
	//屬性
	private int id;
	private String title;//標題
	private String author;//作者

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @param title
	 *            the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @return the author
	 */
	public String getAuthor() {
		return author;
	}

	/**
	 * @param author
	 *            the author to set
	 */
	public void setAuthor(String author) {
		this.author = author;
	}

	// toString
	@Override
	public String toString() {
		return "News [id=" + id + "," + " title=" + title + "," + " author="
				+ author + "]\n";
	}

	/**
	 * 無參構造方法
	 */
	public News() {
	}

	/**
	 * 有參構造方法
	 * @param id
	 * @param title
	 * @param author
	 */
	public News(int id, String title, String author) {
		super();
		this.id = id;
		this.title = title;
		this.author = author;
	}

}
4、測試代碼:
package com.javaxyz.test;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

import org.junit.Test;

import com.javaxyz.equals.News;

/**
 * @ClassName:HashSetDemo.java
 * @Description:Set的運用 
 * @Author:DongGaoYun
 * @AuthorEnglishName:Andy
 * @URL:www.javaxyz.com 或 www.gyun.org
 * @Email:[email protected]
 * @QQ:1050968899
 * @WeiXin:QingYunJiao
 * @WeiXinGongZhongHao: JavaForum
 * @Date:2019-10-25 
 * @Version:1.0 HashSet 優勢: 去重 特有功能:
 * 
 */
public class HashSetDemo1 {
	// 需求:
	// 增加新聞元素
	// 獲取新聞總數
	// 操作HashSet容器,移除元素
	// 判斷是否包含此元素
	// 打印輸出四種方式
	
    //忽略警告
	@SuppressWarnings("all")
	// public static void main(String[] args) {
	@Test
	public void testSet() {

		// 創建對象
		// 創建多態的形式,要注意的點:只能調用父類與子類重寫的方法,子類特有方法無法調用
		Set list = new HashSet();// 多態的形式。//1.父子關係 2.重寫方法 3.父類的引用指向子類對象

		News news1 = new News(1, "張卓1", "green1");
		News news2 = new News(2, "張卓2", "green2");
		News news11 = new News(2, "張卓2", "green2");
		News news3 = new News(3, "張卓3", "green3");
		News news4 = new News(4, "張卓4", "green4");
		News news5 = new News(5, "張卓5", "green5");
		News news6 = new News(6, "張卓6", "green6");
		News news7 = new News(7, "張卓7", "green7");
		News news8 = new News(8, "張卓8", "green8");
		// 插入數據
		list.add(news1);
		list.add(news2);
		list.add(news3);
		// 注意set是無序的,沒有索引,所以報錯
		// list.add(1,news4);
		// 插入數據
		list.add(news6);
		list.add(news11);
		// 總條數
		System.out.println(list.size());

		// 操作HashSet容器,移除元素
		/*
		 * list.remove(0); list.remove(news1);
		 */
		// 判斷是否包含此元素
		System.out.println(list.contains(news7));
		// list
		System.out.println("-------第一種打印輸出方法---start----");
		System.out.print(list);
		System.out.println("-------第一種打印輸出方法---end----");
		System.out.println();
		//System.out.println("-------第二種打印輸出方法-普通for--start----");
		// 普通for不能用

		/*
		 * for (int i = 0; i < list.size(); i++) { News newss = (News)
		 * list.get(i); System.out.println("News [id=" + newss.getId() + "," +
		 * " title=" + newss.getTitle() + "," + " author=" + newss.getAuthor() +
		 * "]"); }
		 */

		//System.out.println("-------第二種打印輸出方法---end----");
		System.out.println();
		System.out.println("-------第二種打印輸出方法-增強for--start----");
		for (Object object : list) {
			News newss = (News) object;
			System.out.println("News [id=" + newss.getId() + "," + " title="
					+ newss.getTitle() + "," + " author=" + newss.getAuthor()
					+ "]");
		}
		System.out.println("-------第二種打印輸出方法---end----");
		System.out.println();
		System.out.println("-------第三種打印輸出方法-轉換成數組--start----");
		/**
		 * toArray Object[] toArray() 返回包含此 collection 中所有元素的數組。如果 collection
		 * 對其迭代器返回的元素順序做出了某些保證,那麼此方法必須以相同的順序返回這些元素。 返回的數組將是“安全的”,因爲此 collection
		 * 並不維護對返回數組的任何引用。(換句話說,即使 collection
		 * 受到數組的支持,此方法也必須分配一個新的數組)。因此,調用者可以隨意修改返回的數組。
		 * 
		 * 此方法充當了基於數組的 API 與基於 collection 的 API 之間的橋樑。
		 * 
		 * 返回: 包含此 collection 中所有元素的數組
		 */

		Object[] obj = list.toArray();
		for (Object object : obj) {
			News newss = (News) object;
			System.out.println("News [id=" + newss.getId() + "," + " title="
					+ newss.getTitle() + "," + " author=" + newss.getAuthor()
					+ "]");
		}

		System.out.println("-------第三種打印輸出方法---end----");
		System.out.println();
		System.out.println("-------第四種打印輸出方法-迭代方式--start----");
		/**
		 * iterator Iterator<E> iterator()
		 * 
		 * boolean hasNext() 如果仍有元素可以迭代,則返回 true。
		 * 
		 * E next() 返回迭代的下一個元素。
		 * 
		 * void remove() 從迭代器指向的 collection 中移除迭代器返回的最後一個元素(可選操作)。
		 */
		Iterator it = list.iterator();
		while (it.hasNext()) {
			News newss = (News) it.next();
			System.out.println("News [id=" + newss.getId() + "," + " title="
					+ newss.getTitle() + "," + " author=" + newss.getAuthor()
					+ "]");
		}
		System.out.println("-------第四種打印輸出方法---end----");
	}
}
5、輸出結果:
5
false
-------第一種打印輸出方法---start----
[News [id=1, title=張卓1, author=green1]
, News [id=2, title=張卓2, author=green2]
, News [id=3, title=張卓3, author=green3]
, News [id=2, title=張卓2, author=green2]
, News [id=6, title=張卓6, author=green6]
]-------第一種打印輸出方法---end----


-------第二種打印輸出方法-增強for--start----
News [id=1, title=張卓1, author=green1]
News [id=2, title=張卓2, author=green2]
News [id=3, title=張卓3, author=green3]
News [id=2, title=張卓2, author=green2]
News [id=6, title=張卓6, author=green6]
-------第二種打印輸出方法---end----

-------第三種打印輸出方法-轉換成數組--start----
News [id=1, title=張卓1, author=green1]
News [id=2, title=張卓2, author=green2]
News [id=3, title=張卓3, author=green3]
News [id=2, title=張卓2, author=green2]
News [id=6, title=張卓6, author=green6]
-------第三種打印輸出方法---end----

-------第四種打印輸出方法-迭代方式--start----
News [id=1, title=張卓1, author=green1]
News [id=2, title=張卓2, author=green2]
News [id=3, title=張卓3, author=green3]
News [id=2, title=張卓2, author=green2]
News [id=6, title=張卓6, author=green6]
-------第四種打印輸出方法---end----
6、從上面的打印中可以看出:
  • Set的輸出是無序的;
  • Set雖然說具有去重的功能,但是自定義對象增加到Set集合或HashSet集合中,還是有重複的對象,怎麼辦呢?有什麼玄機呢?爲什麼沒有去重呢?我們還是看看java的系統類String,我們在String類中把相同的對象增加進去會去重嗎?我們來試試。具體代碼如下:
public class HashSetDemo2_String {
	// 需求:
	// 增加新聞元素
	// 獲取新聞總數
	// String類,如果在HashSet容器增加元素,如果增加的元素是相同的,就會去重。

	@SuppressWarnings("all")
	// public static void main(String[] args) {
	@Test
	public void testSet() {

		// 創建對象
		// 創建多態的形式,要注意的點:只能調用父類與子類重寫的方法,子類特有方法無法調用
		// Set list=new HashSet();//多態的形式。//1.父子關係 2.重寫方法 3.父類的引用指向子類對象

		HashSet list = new HashSet();
		String s1 = new String("abc");
		String s2 = new String("abc");
        String s3 = new String("abc");
		// 增加元素
		list.add(s1);
        // 注意:當向set集合中存儲相同元素時,add(obj)方法返回的是false.
		list.add(s2);
        list.add(s3);
		// 獲取元素總數
		System.out.println(list.size());
		System.out.println();
		//打印輸出
		System.out.println(list);
	}
}
7、輸出結果:
1

[abc]

8、很顯然,java系統類在向Set或HashSet集合裏增加元素時,已經完美的去重了。那我們就看看String類裏重寫了哪些方法,我們來借鑑一下!驚奇的發現了String重寫Object超類中的兩個方法:一個是equals方法(前面介紹過:Java入門-Java學習路線擴展課程:equals的使用),另一個是hashCode方法。源碼如下:
  • 重寫equals方法
public boolean equals(Object anObject) {
    if (this == anObject) {
        return true;
    }
    if (anObject instanceof String) {
        String anotherString = (String) anObject;
        int n = value.length;
        if (n == anotherString.value.length) {
            char v1[] = value;
            char v2[] = anotherString.value;
            int i = 0;
            while (n-- != 0) {
                if (v1[i] != v2[i])
                    return false;
                i++;
            }
            return true;
        }
    }
    return false;
}
  • 重寫hashCode方法

public int hashCode() {
    int h = hash;
    if (h == 0 && value.length > 0) {
        char val[] = value;

        for (int i = 0; i < value.length; i++) {
            h = 31 * h + val[i];
        }
        hash = h;
    }
    return h;
}
9、原來如此,String類用屬性value值作爲底層數據來計算hashCode的,即相同的value就一定會有相同的哈希值。如果value值相同,那麼調用equals方法比較也是相等的;反過來不一定成立。它不保證相同的哈希值一定就是相同的對象。
10、在Java中,String類有個別對象的屬性值不同,但是哈希值相同,比如字符串"gdejicbegh"與字符串"hgebcijedg"具有相同的哈希值-801038016。代碼如下:
		HashSet list = new HashSet();
		String s1 = new String("gdejicbegh");
		String s2 = new String("hgebcijedg");
		System.out.println(s1.hashCode()==s2.hashCode());
		System.out.println(s1.hashCode());
		System.out.println(s2.hashCode());
11、輸出結果:
true
-801038016
-801038016
12、結論如下:
  • 如果equals比較後相等,則hashCode一定會相等。   更多免費資料請加微信公衆號:javaforum
  • 如果hashCode的哈希值相等,equals就不一定相等,注意:它不保證相同的哈希值一定就是相同的對象。
13、小夥伴們是不是有種豁然開朗的感覺?我們來改造一下News.java類,改造代碼如下:
package com.javaxyz.equals;

/**
 * @ClassName:News.java
 * @Description:描述信息
 * @Author:DongGaoYun
 * @AuthorEnglishName:Andy
 * @URL:www.javaxyz.com 或 www.gyun.org
 * @Email:[email protected]
 * @QQ:1050968899
 * @WeiXin:QingYunJiao
 * @WeiXinGongZhongHao: JavaForum
 * @Date:2019-10-22 下午2:23:38
 * @Version:1.0 
 * 完成以下基本代碼:  1.屬性  2.get和set方法   3.構造方法  4.toString
 * 重寫Object的兩個方法
 * 1.hashCode方法
 * 2.equals方法
 *  Set集合即可去重。
 * 
 */
public class News {
	// 屬性
	private int id;
	private String title;// 標題
	private String author;// 作者

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @param title
	 *            the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @return the author
	 */
	public String getAuthor() {
		return author;
	}

	/**
	 * @param author
	 *            the author to set
	 */
	public void setAuthor(String author) {
		this.author = author;
	}

	// toString
	@Override
	public String toString() {
		return "News [id=" + id + "," + " title=" + title + "," + " author="
				+ author + "]\n";
	}

	/**
	 * 無參構造方法
	 */
	public News() {
	}

	/**
	 * 有參構造方法
	 * 
	 * @param id
	 * @param title
	 * @param author
	 */
	public News(int id, String title, String author) {
		super();
		this.id = id;
		this.title = title;
		this.author = author;
	}

	/* 
	 * 爲什麼把prime變量值初始化爲31,有以下幾個原因:更多免費資料請加微信公衆號:javaforum
	 * 1.31這個數字不大也不太小
	 * 2.31是一個奇數,也是一個質數,即只能被1和本身整除的數。
	 * 3.如果選擇偶數,乘2相當於移位運算可能導致溢出,數據會丟失
	 * 4.31有個很好的特性,就是用移位和減法來代替乘法,可以得到更好的性能:31*i==(i<<5)-i。現在的JVM可以自動完成這種優化。	 * 
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((author == null) ? 0 : author.hashCode());
		result = prime * result + id;
		result = prime * result + ((title == null) ? 0 : title.hashCode());
		System.out.println("執行的hashCode是:"+result);
		return result;
	}

	/* 
	 * 在我的博文中已經講過: Java入門-Java學習路線擴展課程:equals的使用 更多免費資料請加微信公衆號:javaforum
	 */
	@Override
	public boolean equals(Object obj) {
		//提升效率 判斷傳入的對象與本對象是否是同一個對象
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())//比較兩個對象的字節碼文件是否是同一個字節碼
			return false;
		News other = (News) obj;//向下轉型
		if (author == null) {
			if (other.author != null)
				return false;
		} else if (!author.equals(other.author))
			return false;
		if (id != other.id)
			return false;
		if (title == null) {
			if (other.title != null)
				return false;
		} else if (!title.equals(other.title))
			return false;
		return true;
	}
}
14、測試代碼:
package com.javaxyz.test;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

import org.junit.Test;

import com.javaxyz.equals.News;

/**
 * @ClassName:HashSetDemo.java
 * @Description:Set的運用 
 * @Author:DongGaoYun
 * @AuthorEnglishName:Andy
 * @URL:www.javaxyz.com 或 www.gyun.org
 * @Email:[email protected]
 * @QQ:1050968899
 * @WeiXin:QingYunJiao
 * @WeiXinGongZhongHao: JavaForum
 * @Date:2019-10-25 
 * @Version:1.0 HashSet 優勢: 去重 特有功能:
 * 
 */
public class HashSetDemo1 {
	// 需求:
	// 增加新聞元素
	// 獲取新聞總數
	// 操作HashSet容器,移除元素
	// 判斷是否包含此元素
	// 打印輸出四種方式
	// String類,如果在HashSet容器增加元素,如果增加的元素是相同的,就會去重。

	@SuppressWarnings("all")
	// public static void main(String[] args) {
	@Test
	public void testSet() {

		// 創建對象
		// 創建多態的形式,要注意的點:只能調用父類與子類重寫的方法,子類特有方法無法調用
		Set list = new HashSet();// 多態的形式。//1.父子關係 2.重寫方法 3.父類的引用指向子類對象
		String s1 = new String("gdejicbegh");
		String s2 = new String("hgebcijedg");
		System.out.println(s1.hashCode()==s2.hashCode());
		System.out.println(s1.hashCode());
		System.out.println(s2.hashCode());
		// list.add(s1);
		// list.add(s2);
		//System.out.println(list.size());
		
		
		
		
		News news1 = new News(1, "張卓1", "green1");
		News news2 = new News(2, "張卓2", "green2");
		News news11 = new News(2, "張卓2", "green2");
		News news3 = new News(3, "張卓3", "green3");
		News news4 = new News(4, "張卓4", "green4");
		News news5 = new News(5, "張卓5", "green5");
		News news6 = new News(6, "張卓6", "green6");
		News news7 = new News(7, "張卓7", "green7");
		News news8 = new News(8, "張卓8", "green8");
		// 插入數據
		list.add(news1);
		list.add(news2);
		list.add(news3);
		// 注意set是無序的,沒有索引,所以報錯             更多免費資料請加微信公衆號:javaforum
		// list.add(1,news4);
		// 插入數據
		list.add(news6);
		//注意:自定義對象重寫equals和hashCode方法後,如果是重複元素,這時就會返回false
		System.out.println(list.add(news11));
		// 總條數
		System.out.println(list.size());

		// 操作HashSet容器,移除元素
		/*
		 * list.remove(0); list.remove(news1);
		 */
		// 判斷是否包含此元素
		System.out.println(list.contains(news7));
		// list
		System.out.println("-------第一種打印輸出方法---start----");
		System.out.print(list);
		System.out.println("-------第一種打印輸出方法---end----");
		System.out.println();
		//System.out.println("-------第二種打印輸出方法-普通for--start----");
		// 普通for不能用

		/*
		 * for (int i = 0; i < list.size(); i++) { News newss = (News)
		 * list.get(i); System.out.println("News [id=" + newss.getId() + "," +
		 * " title=" + newss.getTitle() + "," + " author=" + newss.getAuthor() +
		 * "]"); }
		 */

		//System.out.println("-------第二種打印輸出方法---end----");
		System.out.println();
		System.out.println("-------第二種打印輸出方法-增強for--start----");
		for (Object object : list) {
			News newss = (News) object;
			System.out.println("News [id=" + newss.getId() + "," + " title="
					+ newss.getTitle() + "," + " author=" + newss.getAuthor()
					+ "]");
		}
		System.out.println("-------第二種打印輸出方法---end----");
		System.out.println();
		System.out.println("-------第三種打印輸出方法-轉換成數組--start----");
		/**
		 * toArray Object[] toArray() 返回包含此 collection 中所有元素的數組。如果 collection
		 * 對其迭代器返回的元素順序做出了某些保證,那麼此方法必須以相同的順序返回這些元素。 返回的數組將是“安全的”,因爲此 collection
		 * 並不維護對返回數組的任何引用。(換句話說,即使 collection
		 * 受到數組的支持,此方法也必須分配一個新的數組)。因此,調用者可以隨意修改返回的數組。
		 * 
		 * 此方法充當了基於數組的 API 與基於 collection 的 API 之間的橋樑。
		 * 
		 * 返回: 包含此 collection 中所有元素的數組                                  更多免費資料請加微信公衆號:javaforum
		 */

		Object[] obj = list.toArray();
		for (Object object : obj) {
			News newss = (News) object;
			System.out.println("News [id=" + newss.getId() + "," + " title="
					+ newss.getTitle() + "," + " author=" + newss.getAuthor()
					+ "]");
		}

		System.out.println("-------第三種打印輸出方法---end----");
		System.out.println();
		System.out.println("-------第四種打印輸出方法-迭代方式--start----");
		/**
		 * iterator Iterator<E> iterator()
		 * 
		 * boolean hasNext() 如果仍有元素可以迭代,則返回 true。
		 * 
		 * E next() 返回迭代的下一個元素。                          更多免費資料請加微信公衆號:javaforum
		 * 
		 * void remove() 從迭代器指向的 collection 中移除迭代器返回的最後一個元素(可選操作)。
		 */
		Iterator it = list.iterator();
		while (it.hasNext()) {
			News newss = (News) it.next();
			System.out.println("News [id=" + newss.getId() + "," + " title="
					+ newss.getTitle() + "," + " author=" + newss.getAuthor()
					+ "]");
		}
		System.out.println("-------第四種打印輸出方法---end----");
	}
}
15、輸出結果:
true
-801038016
-801038016
false
4
false
-------第一種打印輸出方法---start----
[News [id=1, title=張卓1, author=green1]
, News [id=2, title=張卓2, author=green2]
, News [id=6, title=張卓6, author=green6]
, News [id=3, title=張卓3, author=green3]
]-------第一種打印輸出方法---end----


-------第二種打印輸出方法-增強for--start----
News [id=1, title=張卓1, author=green1]
News [id=2, title=張卓2, author=green2]
News [id=6, title=張卓6, author=green6]
News [id=3, title=張卓3, author=green3]
-------第二種打印輸出方法---end----

-------第三種打印輸出方法-轉換成數組--start----
News [id=1, title=張卓1, author=green1]
News [id=2, title=張卓2, author=green2]
News [id=6, title=張卓6, author=green6]
News [id=3, title=張卓3, author=green3]
-------第三種打印輸出方法---end----

-------第四種打印輸出方法-迭代方式--start----
News [id=1, title=張卓1, author=green1]
News [id=2, title=張卓2, author=green2]
News [id=6, title=張卓6, author=green6]
News [id=3, title=張卓3, author=green3]
-------第四種打印輸出方法---end----

16、由此可見,要想將自定義類的對象存入HashSet集合裏去重,需要注意以下三點:

  • 自定義類中必須同時重寫equals()和hashCode()方法
  • hashCode(): 屬性值相同的對象返回值必須相同, 屬性值不同的返回值儘量不同(提高效率)
  • equals(): 屬性值相同返回true, 屬性值不同返回false,返回false的時候存儲
17、HashSet去重原理:
17.1、使用HashSet集合調用add()方法存儲對象之前,應該注意儘量使重寫的hashCode()方法返回的值不同,減少調用equals方法,提升性能;在調用add方法時,系統會先調用對象的hashCode()方法得到一個哈希值, 然後在HashSet集合中比較是否有哈希值相同的對象
  • 如果沒有哈希值相同的對象就會直接存入HashSet集合
  • 如果有哈希值相同的對象, 就和哈希值相同的對象逐個調用equals()方法進行比較,結果爲false就直接存入, 爲true則不存

       小夥伴們,本章已經結束,你們都懂了嗎?我花了四個小時的時間編寫,記得關注、點贊、分享和關注微信公衆號(javaforum)噢!有疑問或好的建議請與我聯繫噢!持續更新!敬請關注!


——————— 精 選 文 章 ———————
  1. Java入門-Java學習路線課程第一課:初識JAVA
  2. Java入門-Java學習路線課程第二課:變量與數據類型
  3. Java入門-Java學習路線課程第三課:選擇結構
  4. Java入門-Java學習路線課程第四課:循環結構
  5. Java入門-Java學習路線課程第五課:一維數組
  6. Java入門-Java學習路線課程第六課:二維數組
  7. Java入門-Java學習路線課程第七課:類和對象
  8. Java入門-Java學習路線課程第八課:方法和方法重載
  9. Java入門-Java學習路線擴展課程:equals的使用
  10. Java進階-Java學習路線課程第一課:Java集合框架-ArrayList和LinkedList的使用
  11. Spring框架-Java學習路線課程第一課:Spring核心
  12. Spring框架-Java學習路線課程:Spring的擴展配置
  13. java學習:在給學生演示用Myeclipse10.7.1工具生成War時,意外報錯:SECURITY: INTEGRITY CHECK ERROR
  14. 使用jquery發送Ajax請求的幾種異步刷新方式
  15. idea Springboot啓動時內嵌tomcat報錯- An incompatible version [1.1.33] of the APR based Apache Tomcat Native
  16. 一個簡單的SSM框架Demo(登錄(包含攔截器)和註銷

更多免費資源請關注微信公衆號:

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章