【List】判斷集合相等、集合拷貝

【List】判斷集合相等、集合拷貝

  • 【一】判斷集合是否相等
      • 【1】☆使用list中的containAll
      • 【2】使用for循環遍歷+contains方法
      • 【3】將list先排序再轉為String進行比較
      • 【4】使用list.retainAll()方法
      • 【5】使用MD5加密方式
      • 【6】轉換為Java8中的新特性steam流再進行排序來進行比較
  • 【二】準備一個判斷集合是否相等的工具類
  • 【三】List的深拷貝和淺拷貝
      • 【1】什么是淺拷貝(Shallow Copy)和深拷貝(Deep Copy)?
      • 【2】淺拷貝
      • 【3】深拷貝
      • 【4】對象如何實現深拷貝?
  • 【四】List如何實現復制
      • 【1】淺拷貝
        • 【1】循環遍歷復制(含測試方法)
        • 【2】使用 List 實現類的構造方法
        • 【3】使用 list.addAll() 方法
        • 【4】使用 java.util.Collections.copy() 方法
        • 【5】使用 Java 8 Stream API 將 List 復制到另一個 List 中
        • 【6】在 JDK 10 中的使用方式
      • 【2】深拷貝

【一】判斷集合是否相等

【1】☆使用list中的containAll

此方法是判斷list2是否是list的子集,即list2包含于list

    //方法一:使用list中的containsAll方法,此方法是判斷list2是否是list的子集,即list2包含于listpublic static void compareByContainsAll(List<String> list,List list2){boolean flag = false;if (list.size()==list2.size()){if (list.containsAll(list2)){flag = true;}}System.out.println("方法一:"+flag);}

【2】使用for循環遍歷+contains方法

  //方法二:使用for循環遍歷+contains方法public static void compareByFor(List<String> list,List list2){boolean flag = false;if (list.size()==list2.size()){for (String str :list){if (!list2.contains(str)){System.out.println(flag);return;}}flag = true;}System.out.println("方法二:"+flag);}

【3】將list先排序再轉為String進行比較

(此方法由于涉及同集合內的排序,因此需要該集合內數據類型一致)

    //方法三:將list先排序再轉為String進行比較(此方法由于涉及同集合內的排序,因此需要該集合內數據類型一致)public static void compareByString(List<String> list,List list2){boolean flag = false;if (list.size()==list2.size()){//使用外部比較器Comparator進行排序,并利用Java8中新添加的特性方法引用來簡化代碼list.sort(Comparator.comparing(String::hashCode));//使用集合的sort方法對集合進行排序,本質是將集合轉數組,再使用比較器進行排序Collections.sort(list2);if (list.toString().equals(list2.toString())){flag = true;}}System.out.println("方法三:"+flag);}

如果涉及到引用數據的排序比如里面的一個個對象數據,則需要實現Comparable接口,并重寫CompareTo方法,在此方法中指定排序原則

package com.example.demo.utils;import lombok.Data;/*** @author zhangqianwei* @date 2021/9/7 17:25*/
@Data
public class Student  implements Comparable<Student>{private int id;private String name;private int age;private String sex;public Student() {}public Student(int id, String name, int age, String sex) {this.id = id;this.name = name;this.age = age;this.sex = sex;}@Overridepublic int compareTo(Student o) {//按照年齡排序int result=this.getAge()-o.getAge();return result;}
}
    //如果涉及到引用數據的排序比如里面的一個個對象數據,則需要實現Comparable接口,并重寫CompareTo方法,在此方法中指定排序原則public static void compareBySort(){ArrayList<Student> stus=new ArrayList<Student>();Student stu1=new Student(1,"張三",23,"男");Student stu2=new Student(2,"李四",21,"女");Student stu3=new Student(3,"王五",22,"女");Student stu4=new Student(4,"趙六",22,"女");stus.add(0,stu1);stus.add(1,stu2);stus.add(2,stu3);stus.add(3,stu4);System.out.println("原始順序:"+stus);Collections.sort(stus);System.out.println("排序后:"+stus);}

【4】使用list.retainAll()方法

如果集合list2中的元素都在集合list中則list2中的元素不做移除操作,反之如果只要有一個不在list中則會進行移除操作。即:list進行移除操作返回值為:true反之返回值則為false。

    //方法四:使用list.retainAll()方法,此方法本質上是判斷list是否有移除操作,如果list2是list的子集則不進行移除返回false,否則返回true//如果集合list2中的元素都在集合list中則list2中的元素不做移除操作,反之如果只要有一個不在list中則會進行移除操作。即:list進行移除操作返回值為:true反之返回值則為false。public static void compareByRetainAll(List<String> list,List list2){boolean flag = false;if (list.size()==list2.size()){if (!list.retainAll(list2)){flag = true;}System.out.println("方法四:"+flag);}}

【5】使用MD5加密方式

使用MD5加密方式判斷是否相同,這也算是list轉String的一個變化,將元素根據加密規則轉換為String加密字符串具有唯一性故可以進行判斷;
根據唯一性可以想到map中的key也是具有唯一性的,將list中的元素逐個添加進map中作為key然后遍歷比較list2中的元素是否都存在其中,不過這個要求list中的元素不重復

【6】轉換為Java8中的新特性steam流再進行排序來進行比較

public static void compareBySteam(List<String> list,List list2){boolean flag = false;if (list.size() == list2.size()){String steam = list.stream().sorted().collect(Collectors.joining());String steam2 = (String) list2.stream().sorted().collect(Collectors.joining());if (steam.equals(steam2)){flag = true;}}System.out.println("方法六:"+flag);
}

【二】準備一個判斷集合是否相等的工具類

靜態方法,全局調用

package com.example.demo.utils;import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;/*** @author zhangqianwei* @date 2021/10/8 11:46*/
public class compareList {//比較兩個集合是否相同public static void main(String[] args) {List<String> list = new ArrayList<>();list.add("南京");list.add("蘇州");list.add("常州");List list2 = new ArrayList<>();list2.add("常州");list2.add("蘇州");list2.add("南京");compareByContainsAll(list,list2);compareByFor(list,list2);compareByString(list,list2);compareBySort();compareByRetainAll(list,list2);compareBySteam(list,list2);}//方法一:使用list中的containsAll方法,此方法是判斷list2是否是list的子集,即list2包含于listpublic static void compareByContainsAll(List<String> list,List list2){boolean flag = false;if (list.size()==list2.size()){if (list.containsAll(list2)){flag = true;}}System.out.println("方法一:"+flag);}//方法二:使用for循環遍歷+contains方法public static void compareByFor(List<String> list,List list2){boolean flag = false;if (list.size()==list2.size()){for (String str :list){if (!list2.contains(str)){System.out.println(flag);return;}}flag = true;}System.out.println("方法二:"+flag);}//方法三:將list先排序再轉為String進行比較(此方法由于涉及同集合內的排序,因此需要該集合內數據類型一致)public static void compareByString(List<String> list,List list2){boolean flag = false;if (list.size()==list2.size()){//使用外部比較器Comparator進行排序,并利用Java8中新添加的特性方法引用來簡化代碼list.sort(Comparator.comparing(String::hashCode));//使用集合的sort方法對集合進行排序,本質是將集合轉數組,再使用比較器進行排序Collections.sort(list2);if (list.toString().equals(list2.toString())){flag = true;}}System.out.println("方法三:"+flag);}//如果涉及到引用數據的排序比如里面的一個個對象數據,則需要實現Comparable接口,并重寫CompareTo方法,在此方法中指定排序原則public static void compareBySort(){ArrayList<Student> stus=new ArrayList<Student>();Student stu1=new Student(1,"張三",23,"男");Student stu2=new Student(2,"李四",21,"女");Student stu3=new Student(3,"王五",22,"女");Student stu4=new Student(4,"趙六",22,"女");stus.add(0,stu1);stus.add(1,stu2);stus.add(2,stu3);stus.add(3,stu4);System.out.println("原始順序:"+stus);Collections.sort(stus);System.out.println("排序后:"+stus);}//方法四:使用list.retainAll()方法,此方法本質上是判斷list是否有移除操作,如果list2是list的子集則不進行移除返回false,否則返回true//如果集合list2中的元素都在集合list中則list2中的元素不做移除操作,反之如果只要有一個不在list中則會進行移除操作。即:list進行移除操作返回值為:true反之返回值則為false。public static void compareByRetainAll(List<String> list,List list2){boolean flag = false;if (list.size()==list2.size()){if (!list.retainAll(list2)){flag = true;}System.out.println("方法四:"+flag);}}//方法五:使用MD5加密方式判斷是否相同,這也算是list轉String的一個變化,將元素根據加密規則轉換為String加密字符串具有唯一性故可以進行判斷//根據唯一性可以想到map中的key也是具有唯一性的,將list中的元素逐個添加進map中作為key然后遍歷比較list2中的元素是否都存在其中,不過這個要求list中的元素不重復//方法六:轉換為Java8中的新特性steam流再進行排序來進行比較public static void compareBySteam(List<String> list,List list2){boolean flag = false;if (list.size() == list2.size()){String steam = list.stream().sorted().collect(Collectors.joining());String steam2 = (String) list2.stream().sorted().collect(Collectors.joining());if (steam.equals(steam2)){flag = true;}}System.out.println("方法六:"+flag);}}

【三】List的深拷貝和淺拷貝

【1】什么是淺拷貝(Shallow Copy)和深拷貝(Deep Copy)?

淺拷貝只復制某個對象的引用,而不復制對象本身,新舊對象還是共享同一塊內存。深拷貝會創造一個一模一樣的對象,新對象和原對象不共享內存,修改新對象不會改變原對象。

假設 B 復制了 A,當修改 A 時,看 B 是否會發生變化。如果 B 也跟著變了,說明這是淺拷貝,如果 B 沒變,那就是深拷貝。

【2】淺拷貝

對于數據類型是基本數據類型(整型:byte、short、int、long;字符型:char;浮點型:float、double;布爾型:boolean)的成員變量,淺拷貝會直接進行值傳遞,也就是將該屬性值復制一份給新的對象。因為是兩份不同的數據,所以對其中一個對象的該成員變量值進行修改,不會影響另一個對象拷貝得到的數據。

對于數據類型是引用數據類型(比如說成員變量是某個數組、某個類的對象等)的成員變量,淺拷貝會進行引用傳遞,也就是只是將該成員變量的引用值(內存地址)復制一份給新的對象。因為實際上兩個對象的該成員變量都指向同一個實例,在這種情況下,在一個對象中修改該成員變量會影響到另一個對象的該成員變量值。

【3】深拷貝

相對于淺拷貝而言,深拷貝對于引用類型的修改,并不會影響到對應的拷貝對象的值。

備注:一般在討論深拷貝和淺拷貝時,通常是針對引用數據類型而言的。因為基本數據類型在進行賦值操作時(也就是拷貝)是直接將值賦給了新的變量,也就是該變量是原變量的一個副本,這個時候你修改兩者中的任何一個的值都不會影響另一個。而對于引用數據類型來說,在進行淺拷貝時,只是將對象的引用復制了一份,也就是內存地址,即兩個不同的變量指向了同一個內存地址,那么改變任一個變量的值,都是改變這個內存地址所存儲的值,所以兩個變量的值都會改變。

Java 對對象和基本數據類型的處理是不一樣的。在 Java 中,用對象作為入口參數傳遞時,缺省為 “引用傳遞”,也就是說僅僅傳遞了對象的一個”引用”。當方法體對輸入變量修改時,實質上就是直接操作這個對象。 除了在函數傳值的時候是”引用傳遞”,在任何用 ”=” 向對象變量賦值的時候都是”引用傳遞”。

將對象序列化為字節序列后,再通過反序列化即可完美地實現深拷貝。

【4】對象如何實現深拷貝?

Object 對象聲明了 clone() 方法,如下代碼所示。

	/*** Creates and returns a copy of this object.  The precise meaning* of "copy" may depend on the class of the object. The general* intent is that, for any object {@code x}, the expression:* <blockquote>* <pre>* x.clone() != x</pre></blockquote>* will be true, and that the expression:* <blockquote>* <pre>* x.clone().getClass() == x.getClass()</pre></blockquote>* will be {@code true}, but these are not absolute requirements.* While it is typically the case that:* <blockquote>* <pre>* x.clone().equals(x)</pre></blockquote>* will be {@code true}, this is not an absolute requirement.* <p>* By convention, the returned object should be obtained by calling* {@code super.clone}.  If a class and all of its superclasses (except* {@code Object}) obey this convention, it will be the case that* {@code x.clone().getClass() == x.getClass()}.* <p>* By convention, the object returned by this method should be independent* of this object (which is being cloned).  To achieve this independence,* it may be necessary to modify one or more fields of the object returned* by {@code super.clone} before returning it.  Typically, this means* copying any mutable objects that comprise the internal "deep structure"* of the object being cloned and replacing the references to these* objects with references to the copies.  If a class contains only* primitive fields or references to immutable objects, then it is usually* the case that no fields in the object returned by {@code super.clone}* need to be modified.* <p>* The method {@code clone} for class {@code Object} performs a* specific cloning operation. First, if the class of this object does* not implement the interface {@code Cloneable}, then a* {@code CloneNotSupportedException} is thrown. Note that all arrays* are considered to implement the interface {@code Cloneable} and that* the return type of the {@code clone} method of an array type {@code T[]}* is {@code T[]} where T is any reference or primitive type.* Otherwise, this method creates a new instance of the class of this* object and initializes all its fields with exactly the contents of* the corresponding fields of this object, as if by assignment; the* contents of the fields are not themselves cloned. Thus, this method* performs a "shallow copy" of this object, not a "deep copy" operation.* <p>* The class {@code Object} does not itself implement the interface* {@code Cloneable}, so calling the {@code clone} method on an object* whose class is {@code Object} will result in throwing an* exception at run time.** @return     a clone of this instance.* @throws  CloneNotSupportedException  if the object's class does not*               support the {@code Cloneable} interface. Subclasses*               that override the {@code clone} method can also*               throw this exception to indicate that an instance cannot*               be cloned.* @see java.lang.Cloneable*/protected native Object clone() throws CloneNotSupportedException;

Object 的 clone() 方法本身是一個淺拷貝的方法,但是我們可以通過實現 Cloneable 接口,重寫該方法來實現深拷貝,除了調用父類中的 clone() 方法得到新的對象, 還要將該類中的引用變量也 clone 出來。如果只是用 Object 中默認的 clone() 方法,是淺拷貝的。

如下代碼所示,我們創建一個測試類 TestClone,實現深拷貝。

package com.example.test;import lombok.Data;
import lombok.SneakyThrows;@Data
public class TestClone implements Cloneable {private String a;// 構造函數TestClone(String str) {this.a = str;}@Overrideprotected TestClone clone() throws CloneNotSupportedException {TestClone newTestClone = (TestClone) super.clone();newTestClone.setA(this.a);return newTestClone;}@SneakyThrowspublic static void main(String[] args) {TestClone clone1 = new TestClone("a");TestClone clone2 = clone1.clone();System.out.println(clone2.a);     // aclone2.setA("b");System.out.println(clone1.a);     // aSystem.out.println(clone2.a);     // b}
}

【四】List如何實現復制

List 復制時有深拷貝和淺拷貝兩類方式,分述如下。

【1】淺拷貝

List 其本質就是數組,而其存儲的形式是地址,如下圖所示。
在這里插入圖片描述
將 listA 列表淺拷貝為 listB 時,listA 與 listB 指向同一地址,造成的后果就是,改變 listB 的同時也會改變 listA,因為改變listB 就是改變 listB 所指向的地址的內容,由于 listA 也指向同一地址,所以 listA 與 listB 一起改變。其常見的實現方式有如下幾種(以上述代碼中的 TestClone 為測試類)。

【1】循環遍歷復制(含測試方法)
	@SneakyThrowspublic static void main(String[] args) {List<TestClone> listA = new ArrayList<>();TestClone testClone = new TestClone("a");listA.add(testClone);System.out.println(listA);  // [TestClone(a=a)]List<TestClone> listB = new ArrayList<>(listA.size());for (TestClone clone : listA) {listB.add(clone);}System.out.println(listB);  // [TestClone(a=a)]listA.get(0).setA("b");System.out.println(listA);  // [TestClone(a=b)]System.out.println(listB);  // [TestClone(a=b)]}
【2】使用 List 實現類的構造方法
@SneakyThrows
public static void main(String[] args) {List<TestClone> listA = new ArrayList<>();TestClone testClone = new TestClone("a");listA.add(testClone);List<TestClone> listB = new ArrayList<>(listA);
}
【3】使用 list.addAll() 方法
	@SneakyThrowspublic static void main(String[] args) {List<TestClone> listA = new ArrayList<>();TestClone testClone = new TestClone("a");listA.add(testClone);List<TestClone> listB = new ArrayList<>();listB.addAll(listA);}
【4】使用 java.util.Collections.copy() 方法
	public static void main(String[] args) {List<TestClone> listA = new ArrayList<>();TestClone clone = new TestClone("a");listA.add(clone);List<TestClone> listB = new ArrayList<>();listB.add(new TestClone("c"));System.out.println(listB);      // [TestClone(a=c)]Collections.copy(listB, listA);System.out.println(listB);      // [TestClone(a=a)]listA.get(0).setA("b");System.out.println(listA);      // [TestClone(a=b)]System.out.println(listB);      // [TestClone(a=b)]}
【5】使用 Java 8 Stream API 將 List 復制到另一個 List 中
	public static void main(String[] args) {List<TestClone> listA = new ArrayList<>();TestClone clone = new TestClone("a");listA.add(clone);List<TestClone> listB = listA.stream().collect(Collectors.toList());System.out.println(listB); // [TestClone(a=a)]listA.get(0).setA("b");System.out.println(listA); // [TestClone(a=b)]System.out.println(listB); // [TestClone(a=b)]}
【6】在 JDK 10 中的使用方式
	public static void main(String[] args) {List<TestClone> listA = new ArrayList<>();TestClone clone = new TestClone("a");listA.add(clone);List<TestClone> listB = List.copyOf(listA);listA.get(0).setA("b");System.out.println(listA);                  // [TestClone@76ed5528]System.out.println(listA.get(0).getA());    // bSystem.out.println(listB);                  // [TestClone@76ed5528]System.out.println(listB.get(0).getA());    // b}

【2】深拷貝

在這里插入圖片描述
如圖,深拷貝就是將 listA 復制給 listB 的同時,給 listB 創建新的地址,再將地址 A 的內容傳遞到地址 B。listA 與 listB 內容一致,但是由于所指向的地址不同,所以各自改變內容不會影響對方。深拷貝時,向新列表添加的是原列表中的元素執行 clone() 方法后的新對象。

	@SneakyThrowspublic static void main(String[] args) {List<TestClone> listA = new ArrayList<>();TestClone testClone = new TestClone("a");listA.add(testClone);List<TestClone> listB = new ArrayList<>();listB.add(listA.get(0).clone());System.out.println(listB);  // [TestClone(a=a)]listA.get(0).setA("b");System.out.println(listA);  // [TestClone(a=b)]System.out.println(listB);  // [TestClone(a=a)]}

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/38651.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/38651.shtml
英文地址,請注明出處:http://en.pswp.cn/web/38651.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

AI數字人直播源碼出售價格公布!

隨著數字人行業的興起&#xff0c;以數字人直播為代表的應用場景逐漸成為人們日常生活中不可分割的一部分&#xff0c;再加上艾媒研究數據顯示&#xff0c;超五成以上的被調查群體的企業使用過虛擬人技術&#xff0c;超三成被調查群體的企業計劃使用虛擬人技術等結論的公布&…

python-圖像模糊處理(賽氪OJ)

[題目描述] 給定 n 行 m 列的圖像各像素點的灰度值&#xff0c;要求用如下方法對其進行模糊化處理&#xff1a; 1. 四周最外側的像素點灰度值不變。 2. 中間各像素點新灰度值為該像素點及其上下左右相鄰四個像素點原灰度值的平均&#xff08;四舍五入&#xff09;輸入&#xff…

【C語言】inline 關鍵字

在C語言中&#xff0c;inline關鍵字用于建議編譯器對函數進行內聯展開&#xff0c;而不是像普通函數一樣調用。內聯函數的目的是減少函數調用的開銷&#xff0c;特別是對于簡單的、頻繁調用的函數。 內聯函數的定義和使用 定義內聯函數 要定義一個內聯函數&#xff0c;需要在…

《代號鳶》國服,能否推動國乙市場重新洗牌?

靈犀互娛《如鳶》順利拿到版號&#xff0c;再次攪渾了國乙市場這潭水。 六月份游戲版號審批公布后&#xff0c;靈犀互娛運營的《如鳶》引起了關注&#xff0c;這個與《代號鳶》原名《三國志如鳶》雷同的名字&#xff0c;竟然讓《代號鳶》玩家大面積破防了。 其實目前關于《如…

for循環中list觸發fast-fail或不觸發的原理和方法

Iterable和Iterator Iterator接口位于的位置是java.util.Iterator&#xff0c;它主要有兩個抽象方法供子類實現。hasNext()用來判斷還有沒有數據可供訪問&#xff0c;next()用來訪問下一個數據。 集合Collection不是直接去實現Iterator接口&#xff0c;而是去實現Iterable接口…

【Python】字典練習

python期考練習 目錄 1. 首都名?編輯 2. 摩斯電碼 3. 登錄 4. 學生的姓名和年齡?編輯 5. 電商 6. 學生基本信息 7. 字母數 1. 首都名 初始字典 (可復制) : d{"China":"Beijing","America":"Washington","Norway":…

HCM智能人力資源系統存在命令執行漏洞Getshell

0x01 閱讀須知 技術文章僅供參考&#xff0c;此文所提供的信息只為網絡安全人員對自己所負責的網站、服務器等&#xff08;包括但不限于&#xff09;進行檢測或維護參考&#xff0c;未經授權請勿利用文章中的技術資料對任何計算機系統進行入侵操作。利用此文所提供的信息而造成…

防爆對講終端是什么?在哪些行業中應用廣泛?

防爆對講終端是一種特殊設計的通信設備&#xff0c;它具備防爆性能和可靠的通信功能&#xff0c;確保在存在爆炸性氣體或粉塵的危險環境中使用時不會引發爆炸或火災等危險情況。這種設備通過特殊的設計和防護措施&#xff0c;如采用防爆材料、防靜電、絕緣、阻燃材料等&#xf…

ABAQUS軟件天津正版代理商億達四方:創新技術,驅動產業升級

在環渤海經濟圈的核心地帶——天津&#xff0c;隨著智能制造與高新技術產業的蓬勃發展&#xff0c;對高端仿真軟件的需求日益增長。億達四方&#xff0c;作為ABAQUS在天津的官方正版代理商&#xff0c;憑借其深厚的行業經驗和卓越的服務體系&#xff0c;正為這片熱土上的科研機…

2024年度濰坊市職業技能大賽——網絡搭建(網絡與信息安全管理員)職業技能競賽樣題

2024年度濰坊市職業技能大賽 ——網絡搭建&#xff08;網絡與信息安全管理員&#xff09;職業技能競賽樣題 網絡搭建職業技能競賽組委會 2024年6月 一、項目簡介 &#xff08;一&#xff09;競賽須知 1.技能操作比賽時間150分鐘&#xff0c;你需要合理分配時間。 2.如果沒…

Hive常用的內置函數

文章目錄 聚合類1.指定列值的數目2.指定列值求和3.最大值4.最小值5.平均值6.中位數函數7.分位數函數 數值類1.取整函數Round(a)2.指定精度取整ROUND(double a,int b)3.向上取整FLOOR()4.向下取整CEIL()5.隨機數 rand()6.絕對值函數 日期類獲取當前日期獲取當前時間戳日期前后日…

C++:枚舉類的使用案例及場景

一、使用案例 在C中&#xff0c;枚舉類&#xff08;也稱為枚舉類型或enum class&#xff09;是C11及以后版本中引入的一種更加強大的枚舉類型。與傳統的枚舉&#xff08;enum&#xff09;相比&#xff0c;枚舉類提供了更好的類型安全性和作用域控制。下面是一個使用枚舉類的案…

(linux系統服務)Linux下yum源配置實戰

一、Linux下軟件包的管理 1、軟件安裝方式 ① RPM包管理&#xff08;需要單獨解決依賴問題&#xff09; ② YUM包管理&#xff08;需要有網絡及YUM倉庫的支持&#xff0c;會自動從互聯網下載軟件&#xff0c;自動解決依賴&#xff09; ③ 源碼安裝&#xff08;安裝過程比較…

總體設計在軟件設計中的意義

總體設計&#xff08;High-Level Design, HLD&#xff09;是軟件開發生命周期中的一個關鍵階段&#xff0c;旨在從宏觀層面定義系統的結構和主要組件。總體設計的目標是為詳細設計和實現提供一個清晰的框架和藍圖。 總體設計的意義 明確系統架構&#xff1a;總體設計幫助開發…

基于Java的外賣點餐系統設計與實現

作者介紹&#xff1a;計算機專業研究生&#xff0c;現企業打工人&#xff0c;從事Java全棧開發 主要內容&#xff1a;技術學習筆記、Java實戰項目、項目問題解決記錄、AI、簡歷模板、簡歷指導、技術交流、論文交流&#xff08;SCI論文兩篇&#xff09; 上點關注下點贊 生活越過…

深?理解 JVM 底層原理、垃圾回收機制,能通過mat、jstat進行JVM參數調優

深入理解JVM&#xff08;Java虛擬機&#xff09;底層原理和垃圾回收機制是Java開發者和系統管理員的重要技能&#xff0c;尤其是在性能調優方面。下面是一些關鍵點&#xff0c;幫助你更好地理解這些概念&#xff1a; ### JVM 底層原理 1. **類加載機制**&#xff1a;JVM如何加…

java+mysql教師管理系統

完整源碼地址 教師信息管理系統使用命令行交互的方式及數據庫連接實現教師信息管理系統&#xff0c;該系統旨在實現教師信息的管理&#xff0c;并根據需要進行教師信息展示。該軟件的功能有如下功能 (1)基本信息管理(教師號、姓名、性別、出生年月、職稱、學歷、學位、教師類型…

25西安電子科技大學研究生政策(最新)

25西安電子科技大學研究生政策&#xff08;最新&#xff09; 01全國研究生報名情況 全國研究生報名人數438萬&#xff0c;首次下降超36萬人。 02西電研究生全日制/非全日制報名情況 西電碩士研究生報考錄取情況&#xff08;包含全日制、非全日制&#xff09;&#xff0c;2024年…

python-數據容器對比總結

基于各類數據容器的特點&#xff0c;它們的應用場景如下&#xff1a; 數據容器的通用操作 - 遍歷 數據容器的通用統計功能 容器的通用轉換功能 容器通用排序功能 容器通用功能總覽

C-特性和新特性

C特性和新特性 C11 C11是C編程語言的一個重要標準版本&#xff0c;是C98標準發布后13年來的第一次重大修正&#xff0c;它引入了許多新特性和改進&#xff0c;極大地增強了C語言的表達能力和開發效率。 C11是C編程語言的一個重要標準版本&#xff0c;由國際標準化組織(ISO)和…