xerga 1 year ago
parent
commit
908ce18fb1
100 changed files with 3157 additions and 0 deletions
  1. 6 0
      JavaSE/.idea/inspectionProfiles/Project_Default.xml
  2. 10 0
      JavaSE/.idea/modules.xml
  3. 124 0
      JavaSE/.idea/uiDesigner.xml
  4. 10 0
      JavaSE/day03/day03.iml
  5. 54 0
      JavaSE/day03/src/TestZhiShu17.java
  6. 11 0
      JavaSE/day04/day04.iml
  7. 41 0
      JavaSE/day04/src/com/lc/day04/method01/Test01.java
  8. 35 0
      JavaSE/day04/src/com/lc/day04/method01/Test02.java
  9. 38 0
      JavaSE/day04/src/com/lc/day04/method01/Test03.java
  10. 34 0
      JavaSE/day04/src/com/lc/day04/method01/Test04.java
  11. 40 0
      JavaSE/day04/src/com/lc/day04/method01/Test05.java
  12. 27 0
      JavaSE/day04/src/com/lc/day04/obj/Person.java
  13. 43 0
      JavaSE/day04/src/com/lc/day04/obj/TestPerson.java
  14. 18 0
      JavaSE/day04/src/com/lc/day04/obj1/Husband.java
  15. 41 0
      JavaSE/day04/src/com/lc/day04/obj1/Test.java
  16. 19 0
      JavaSE/day04/src/com/lc/day04/obj1/Wife.java
  17. 20 0
      JavaSE/day04/src/com/lc/day04/obj2/Student.java
  18. 83 0
      JavaSE/day04/src/com/lc/day04/obj2/Test01.java
  19. 11 0
      JavaSE/day05/day05.iml
  20. 28 0
      JavaSE/day05/src/com/lc/day05/constract05/Person.java
  21. 25 0
      JavaSE/day05/src/com/lc/day05/constract05/Test01.java
  22. 11 0
      JavaSE/day05/src/com/lc/day05/constract06/Person.java
  23. 22 0
      JavaSE/day05/src/com/lc/day05/constract06/Student.java
  24. 24 0
      JavaSE/day05/src/com/lc/day05/constract06/TestStudent.java
  25. 59 0
      JavaSE/day05/src/com/lc/day05/constract07/Person.java
  26. 21 0
      JavaSE/day05/src/com/lc/day05/constract07/TestPerson.java
  27. 76 0
      JavaSE/day05/src/com/lc/day05/fz08/Person.java
  28. 36 0
      JavaSE/day05/src/com/lc/day05/fz08/TestPerson.java
  29. 46 0
      JavaSE/day05/src/com/lc/day05/method01/MathTools.java
  30. 39 0
      JavaSE/day05/src/com/lc/day05/method01/Test01.java
  31. 30 0
      JavaSE/day05/src/com/lc/day05/method02/Test01.java
  32. 38 0
      JavaSE/day05/src/com/lc/day05/method02/Test02.java
  33. 33 0
      JavaSE/day05/src/com/lc/day05/method02/Test03.java
  34. 32 0
      JavaSE/day05/src/com/lc/day05/method02/Test04.java
  35. 52 0
      JavaSE/day05/src/com/lc/day05/method03/Test05.java
  36. 37 0
      JavaSE/day05/src/com/lc/day05/method04/Test06.java
  37. 34 0
      JavaSE/day05/src/com/lc/day05/method04/Test07.java
  38. 11 0
      JavaSE/day06/day06.iml
  39. 22 0
      JavaSE/day06/src/com/lc/day06/extends01/Animal.java
  40. 19 0
      JavaSE/day06/src/com/lc/day06/extends01/Cat.java
  41. 17 0
      JavaSE/day06/src/com/lc/day06/extends01/Dog.java
  42. 34 0
      JavaSE/day06/src/com/lc/day06/extends01/Test01.java
  43. 47 0
      JavaSE/day06/src/com/lc/day06/extends02/Test01.java
  44. 26 0
      JavaSE/day06/src/com/lc/day06/extends03override/Car.java
  45. 36 0
      JavaSE/day06/src/com/lc/day06/extends03override/SmartCar.java
  46. 23 0
      JavaSE/day06/src/com/lc/day06/extends03override/Test.java
  47. 65 0
      JavaSE/day06/src/com/lc/day06/extends04override/Test.java
  48. 21 0
      JavaSE/day06/src/com/lc/day06/triangle/Exer01.java
  49. 73 0
      JavaSE/day06/src/com/lc/day06/triangle/Triangle.java
  50. 11 0
      JavaSE/day07-polymorphic/day07-polymorphic.iml
  51. 17 0
      JavaSE/day07-polymorphic/src/com/lc/abstract01/Animal.java
  52. 19 0
      JavaSE/day07-polymorphic/src/com/lc/abstract01/Cat.java
  53. 21 0
      JavaSE/day07-polymorphic/src/com/lc/abstract01/Dog.java
  54. 11 0
      JavaSE/day07-polymorphic/src/com/lc/abstract01/Food.java
  55. 11 0
      JavaSE/day07-polymorphic/src/com/lc/abstract01/GouLiang.java
  56. 11 0
      JavaSE/day07-polymorphic/src/com/lc/abstract01/MaoLiang.java
  57. 31 0
      JavaSE/day07-polymorphic/src/com/lc/abstract01/Test.java
  58. 78 0
      JavaSE/day07-polymorphic/src/com/lc/abstract02/Test01.java
  59. 55 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic01/Test01.java
  60. 16 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic02/Animal.java
  61. 17 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic02/Cat.java
  62. 16 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic02/Dog.java
  63. 35 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic02/Test.java
  64. 18 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic03/Animal.java
  65. 23 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic03/Cat.java
  66. 24 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic03/Test.java
  67. 12 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic04/Animal.java
  68. 11 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic04/Cat.java
  69. 11 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic04/Dog.java
  70. 28 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic04/Pet.java
  71. 32 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic04/Test01.java
  72. 23 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic05/Apple.java
  73. 38 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic05/Fruit.java
  74. 20 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic05/Ginseng.java
  75. 50 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic05/Orchard.java
  76. 43 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic05/Test.java
  77. 33 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic05/Test01.java
  78. 11 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic06/Animal.java
  79. 11 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic06/Cat.java
  80. 16 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic06/Dog.java
  81. 43 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic06/Test01.java
  82. 49 0
      JavaSE/day07-polymorphic/src/com/lc/polymorphic06/Test02.java
  83. 11 0
      JavaSE/day08-interface/day08-interface.iml
  84. 30 0
      JavaSE/day08-interface/src/com/lc/day08/interface01/BYDCar.java
  85. 45 0
      JavaSE/day08-interface/src/com/lc/day08/interface01/CarIntegerface.java
  86. 11 0
      JavaSE/day08-interface/src/com/lc/day08/interface01/Fuel.java
  87. 28 0
      JavaSE/day08-interface/src/com/lc/day08/interface01/Test.java
  88. 57 0
      JavaSE/day08-interface/src/com/lc/day08/interface02/Test01.java
  89. 15 0
      JavaSE/day08-interface/src/com/lc/day08/interface03/B.java
  90. 18 0
      JavaSE/day08-interface/src/com/lc/day08/interface03/Father.java
  91. 20 0
      JavaSE/day08-interface/src/com/lc/day08/interface03/FlyInterface.java
  92. 33 0
      JavaSE/day08-interface/src/com/lc/day08/interface03/Son.java
  93. 17 0
      JavaSE/day08-interface/src/com/lc/day08/interface03/Swimming.java
  94. 18 0
      JavaSE/day08-interface/src/com/lc/day08/interface03/Test01.java
  95. 25 0
      JavaSE/day08-interface/src/com/lc/day08/interface04/MyComparator.java
  96. 60 0
      JavaSE/day08-interface/src/com/lc/day08/interface04/Person.java
  97. 49 0
      JavaSE/day08-interface/src/com/lc/day08/interface04/Test01.java
  98. 49 0
      JavaSE/day08-interface/src/com/lc/day08/interface05/ArrayTools.java
  99. 76 0
      JavaSE/day08-interface/src/com/lc/day08/interface05/Employee.java
  100. 48 0
      JavaSE/day08-interface/src/com/lc/day08/interface05/Test01.java

+ 6 - 0
JavaSE/.idea/inspectionProfiles/Project_Default.xml

@@ -0,0 +1,6 @@
+<component name="InspectionProjectProfileManager">
+  <profile version="1.0">
+    <option name="myName" value="Project Default" />
+    <inspection_tool class="MarkedForRemoval" enabled="false" level="ERROR" enabled_by_default="false" />
+  </profile>
+</component>

+ 10 - 0
JavaSE/.idea/modules.xml

@@ -3,9 +3,19 @@
   <component name="ProjectModuleManager">
     <modules>
       <module fileurl="file://$PROJECT_DIR$/JavaSE.iml" filepath="$PROJECT_DIR$/JavaSE.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day-interface/day-interface.iml" filepath="$PROJECT_DIR$/day-interface/day-interface.iml" />
       <module fileurl="file://$PROJECT_DIR$/day01/day01.iml" filepath="$PROJECT_DIR$/day01/day01.iml" />
       <module fileurl="file://$PROJECT_DIR$/day02/day02.iml" filepath="$PROJECT_DIR$/day02/day02.iml" />
       <module fileurl="file://$PROJECT_DIR$/day03/day03.iml" filepath="$PROJECT_DIR$/day03/day03.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day04/day04.iml" filepath="$PROJECT_DIR$/day04/day04.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day05/day05.iml" filepath="$PROJECT_DIR$/day05/day05.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day06/day06.iml" filepath="$PROJECT_DIR$/day06/day06.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day08-interface/day08-interface.iml" filepath="$PROJECT_DIR$/day08-interface/day08-interface.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day09/day09.iml" filepath="$PROJECT_DIR$/day09/day09.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day_coll_10/day_coll_10.iml" filepath="$PROJECT_DIR$/day_coll_10/day_coll_10.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day_ex/day_ex.iml" filepath="$PROJECT_DIR$/day_ex/day_ex.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day_integer/day_integer.iml" filepath="$PROJECT_DIR$/day_integer/day_integer.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day_string/day_string.iml" filepath="$PROJECT_DIR$/day_string/day_string.iml" />
     </modules>
   </component>
 </project>

+ 124 - 0
JavaSE/.idea/uiDesigner.xml

@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Palette2">
+    <group name="Swing">
+      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
+      </item>
+      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
+        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
+        <initial-values>
+          <property name="text" value="Button" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="RadioButton" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="CheckBox" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="Label" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
+          <preferred-size width="-1" height="20" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
+      </item>
+    </group>
+  </component>
+</project>

+ 10 - 0
JavaSE/day03/day03.iml

@@ -7,5 +7,15 @@
     </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library name="JUnit4">
+        <CLASSES>
+          <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.13.1/junit-4.13.1.jar!/" />
+          <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
   </component>
 </module>

+ 54 - 0
JavaSE/day03/src/TestZhiShu17.java

@@ -1,3 +1,6 @@
+import org.junit.Test;
+
+import java.time.LocalTime;
 import java.util.Scanner;
 
 /**
@@ -41,4 +44,55 @@ public class TestZhiShu17 {
          System.out.println(end - start);
 
      }
+
+
+     @Test
+     public void test01(){
+         String str = null;
+         StringBuffer sb = new StringBuffer();
+         sb.append(str);
+
+         System.out.println(sb.length());//
+
+         System.out.println(sb);//
+
+         StringBuffer sb1 = new StringBuffer(str);
+         System.out.println(sb1);//
+         
+     }
+
+    @Test
+    public void test02(){
+        //两个 for  用i 控制 j
+
+        //声明 数组
+        int[][] arr = new int[10][];
+
+        for (int i = 0; i < 10 ; i++) {
+            //动态创建数组
+            arr[i] =  new int[i+1];
+
+            //赋值第一列
+            arr[i][0] = 1;
+            //最后一列
+            arr[i][i] = 1;
+            for (int j = 1; j < i ; j++) {
+                arr[i][j] = arr[i-1][j] + arr[i-1][j-1];
+            }
+        }
+
+        //输出数组
+        for (int i = 0; i < arr.length ; i++) {
+
+            for (int j = 0; j < arr[i].length  ; j++) {
+                System.out.print(arr[i][j]+ ""+'\t');
+            }
+            System.out.println();
+        }
+
+
+
+    }
+
+
 }

+ 11 - 0
JavaSE/day04/day04.iml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 41 - 0
JavaSE/day04/src/com/lc/day04/method01/Test01.java

@@ -0,0 +1,41 @@
+package com.lc.day04.method01;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/27 13:56
+ * @Version 1.0
+ */
+public class Test01 {
+
+
+    public static void main(String[] args) {
+        Test01 test01 = new Test01();
+        //数组
+        int[] arr = {1,4,12,4,7,8,23,45,90,1};
+
+        //调用
+        test01.sortArr(arr);
+
+        //输出
+        System.out.println(Arrays.toString(arr));
+    }
+
+    public void sortArr( int[] arr ){
+        //排序
+        for (int i = 0; i < arr.length-1; i++) {
+            for (int j = 0; j < arr.length-1-i; j++) {
+                if ( arr[j] > arr[j+1] ){
+                    int temp = arr[j];
+                    arr[j] = arr[j+1];
+                    arr[j+1] = temp;
+                }
+            }
+        }
+    }
+
+
+}

+ 35 - 0
JavaSE/day04/src/com/lc/day04/method01/Test02.java

@@ -0,0 +1,35 @@
+package com.lc.day04.method01;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/27 13:56
+ * @Version 1.0
+ */
+public class Test02 {
+
+
+    public static void main(String[] args) {
+        Test02 test02 = new Test02();
+
+        //调用
+        //返回值
+        int n = test02.getNumber();
+        //输出
+        System.out.println(n);
+    }
+
+    public int getNumber( ){
+        //方法逻辑
+        //int number = (int)(Math.random()*100)+1;
+        // 变量
+        //return number;
+        // 直接返回
+        return (int)(Math.random()*100)+1;
+    }
+
+
+}

+ 38 - 0
JavaSE/day04/src/com/lc/day04/method01/Test03.java

@@ -0,0 +1,38 @@
+package com.lc.day04.method01;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/27 13:56
+ * @Version 1.0
+ */
+public class Test03 {
+
+
+    public static void main(String[] args) {
+        Test03 test03 = new Test03();
+        int[] arr = {1,4,12,4,7,8,23,45,90,1};
+
+        int index2Arr = test03.getIndex2Arr(arr, 1);
+        System.out.println(index2Arr);
+
+    }
+
+    public int getIndex2Arr(int[] arr , int val ){
+        //索引
+        int index = -1;
+
+        //顺序
+        for (int i = 0; i < arr.length; i++) {
+            if (val == arr[i]){
+                //index = i;
+                return i;
+                //break;
+            }
+        }
+        return index;
+    }
+
+
+}

+ 34 - 0
JavaSE/day04/src/com/lc/day04/method01/Test04.java

@@ -0,0 +1,34 @@
+package com.lc.day04.method01;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/27 13:56
+ * @Version 1.0
+ */
+public class Test04 {
+
+
+    public static void main(String[] args) {
+
+    }
+
+    public int a(int[] arr , int val ){
+
+        return val;
+    }
+
+
+    public void b(int[] arr , int val ){
+        if(true){
+            System.out.println("123");
+            return;
+        }
+        System.out.println("123");
+        return;
+    }
+
+
+
+}

+ 40 - 0
JavaSE/day04/src/com/lc/day04/method01/Test05.java

@@ -0,0 +1,40 @@
+package com.lc.day04.method01;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/27 13:56
+ * @Version 1.0
+ */
+public class Test05 {
+
+    public static void main(String[] args) {
+        Test05 test05 = new Test05();
+
+        test05.aVoid();
+    }
+
+    public void aVoid(){
+        bVoid();
+        System.out.println("aVoid");
+    }
+
+    public void bVoid(){
+        cVoid();
+        System.out.println("bVoid");
+    }
+
+    public void cVoid(){
+        dVoid();
+        System.out.println("cVoid");
+
+    }
+
+    public void dVoid(){
+        System.out.println("cVoid");
+    }
+
+
+
+}

+ 27 - 0
JavaSE/day04/src/com/lc/day04/obj/Person.java

@@ -0,0 +1,27 @@
+package com.lc.day04.obj;
+
+/**
+ * ClassName: Person
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/27 9:37
+ * @Version 1.0
+ */
+public class Person {
+
+    //成员变量
+    public String name;
+
+    public int age;
+
+
+    // 成员方法
+    public void sleep(){
+        System.out.println( name + "-sleep");
+    }
+
+    public void eat(){
+        System.out.println( name+"-eat");
+    }
+
+}

+ 43 - 0
JavaSE/day04/src/com/lc/day04/obj/TestPerson.java

@@ -0,0 +1,43 @@
+package com.lc.day04.obj;
+
+/**
+ * ClassName: TestPerson
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/27 9:46
+ * @Version 1.0
+ */
+public class TestPerson {
+
+    public static void main(String[] args) {
+        //数据类型 名称 = new 类名();
+        Person person = new Person();
+
+        System.out.println(person);
+
+        //调用
+        person.name = "凡凡";
+        person.age = 22;
+
+        //调用方法
+        person.sleep();
+        person.eat();
+
+        //第二个实例
+        Person person1 = new Person();
+
+        System.out.println(person1.name); // 默认值
+
+        person1.sleep(); // name null
+
+
+        //person = person1;
+        person1 = person;
+
+//        System.out.println(person.name); //  null
+//        System.out.println(person.age);  //  0
+
+        System.out.println(person1.name); //  凡凡
+        System.out.println(person1.age);  //  22
+    }
+}

+ 18 - 0
JavaSE/day04/src/com/lc/day04/obj1/Husband.java

@@ -0,0 +1,18 @@
+package com.lc.day04.obj1;
+
+/**
+ * ClassName: Husband
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/27 11:01
+ * @Version 1.0
+ */
+public class Husband {
+
+    //姓名
+    String name;
+    //年龄
+    int age;
+
+    Wife wife;
+}

+ 41 - 0
JavaSE/day04/src/com/lc/day04/obj1/Test.java

@@ -0,0 +1,41 @@
+package com.lc.day04.obj1;
+
+/**
+ * ClassName: Test
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/27 11:03
+ * @Version 1.0
+ */
+public class Test {
+
+    public static void main(String[] args) {
+        //丈夫
+        Husband husband = new Husband();
+        //妻子
+        Wife wife= new Wife(); // 0x1122
+
+        System.out.println(wife);
+
+        husband.name = "zs";
+        husband.age = 28;
+        //妻子 赋值。
+        husband.wife = wife;
+
+        System.out.println(husband.wife);
+
+        //其中名称 年龄  赋值方式
+        // wife.属性 赋值
+        // husband.wife.名称 年龄
+
+        husband.wife.name = "小红";
+        husband.wife.age = 22;
+
+
+        System.out.println(wife.name);
+        System.out.println(wife.age);
+
+
+
+    }
+}

+ 19 - 0
JavaSE/day04/src/com/lc/day04/obj1/Wife.java

@@ -0,0 +1,19 @@
+package com.lc.day04.obj1;
+
+/**
+ * ClassName: Wife
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/27 11:02
+ * @Version 1.0
+ */
+public class Wife {
+
+    //姓名
+    String name;
+    //年龄
+    int age;
+
+    Husband husband;
+
+}

+ 20 - 0
JavaSE/day04/src/com/lc/day04/obj2/Student.java

@@ -0,0 +1,20 @@
+package com.lc.day04.obj2;
+
+/**
+ * ClassName: Student
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/27 15:43
+ * @Version 1.0
+ */
+public class Student {
+    //学号number(int),年级state(int),成绩score(int)
+    public int number;
+    public int state;
+    public int score;
+
+    public String getInfo(){
+        return "number:"+number+",state:"+state+",score:"+score;
+    }
+
+}

+ 83 - 0
JavaSE/day04/src/com/lc/day04/obj2/Test01.java

@@ -0,0 +1,83 @@
+package com.lc.day04.obj2;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/27 15:43
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) {
+
+        Test01 t = new Test01();
+        //创建数组
+        Student[] arr = t.getArr(20);
+        System.out.println("------------");
+        //查看
+        t.printArr(arr);
+
+        //根据条件查询
+        System.out.println("------------");
+        t.printArr2State(arr, 3);
+
+        //排序
+        t.sort(arr);
+        System.out.println("--------------------");
+        //查看
+        t.printArr(arr);
+
+
+    }
+    //使用冒泡排序按学生成绩排序,
+    public void sort(Student[] arr){
+        for (int i = 0; i < arr.length-1; i++) {
+            for (int j = 0; j < arr.length-1-i; j++) {
+                //排序
+                if ( arr[j].score > arr[j+1].score ){
+                    //交换
+                    Student temp = arr[j];
+                    arr[j] = arr[j+1];
+                    arr[j+1] = temp;
+                }
+            }
+        }
+    }
+
+
+    //打印出3年级(state值为3)的学生信息。
+    public void printArr2State(Student[] arr , int state ){
+        for (int i = 0; i < arr.length; i++) {
+            if (arr[i].state == state ){
+                System.out.println(arr[i].getInfo());
+            }
+        }
+    }
+
+    //查看数组内容方法
+    public void printArr(Student[] arr ){
+        for (int i = 0; i < arr.length; i++) {
+            System.out.println(arr[i].getInfo());
+        }
+    }
+
+
+    public Student[] getArr(int length){
+        Student[] students = new Student[length];
+
+        for (int i = 0; i < students.length; i++) {
+            Student student = new Student();
+            student.number = i+1; //学号
+            student.state = (int) (Math.random()*3)+1; //年级
+            student.score = (int) (Math.random()*50)+50; //年级
+            //放入数组
+            students[i] = student;
+        }
+        //返回
+        return students;
+    }
+
+}

+ 11 - 0
JavaSE/day05/day05.iml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 28 - 0
JavaSE/day05/src/com/lc/day05/constract05/Person.java

@@ -0,0 +1,28 @@
+package com.lc.day05.constract05;
+
+/**
+ * ClassName: Person
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/28 13:41
+ * @Version 1.0
+ */
+public class Person {
+
+    public String name;
+    public int age;
+
+    /*
+    构造
+     */
+    public Person(){
+        System.out.println("构造方法执行");
+    }
+
+    //有参数
+    public Person(String n  , int a ){
+        name = n;
+        age = a;
+    }
+
+}

+ 25 - 0
JavaSE/day05/src/com/lc/day05/constract05/Test01.java

@@ -0,0 +1,25 @@
+package com.lc.day05.constract05;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/28 13:40
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) {
+        //创建对象
+        //调用构造方法
+        Person person = new Person();
+
+        //调用 有参数的构造
+        Person person1 = new Person("坤坤", 28);
+
+        System.out.println(person1.name);
+        System.out.println(person1.age);
+
+    }
+
+}

+ 11 - 0
JavaSE/day05/src/com/lc/day05/constract06/Person.java

@@ -0,0 +1,11 @@
+package com.lc.day05.constract06;
+
+/**
+ * ClassName: Person
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/28 13:51
+ * @Version 1.0
+ */
+class Person {
+}

+ 22 - 0
JavaSE/day05/src/com/lc/day05/constract06/Student.java

@@ -0,0 +1,22 @@
+package com.lc.day05.constract06;
+
+/**
+ * ClassName: Student
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/28 13:47
+ * @Version 1.0
+ */
+public class Student {
+
+    public String name;
+
+    public Student( String n ){
+        name = n;
+    }
+
+    public Student( ){
+
+    }
+
+}

+ 24 - 0
JavaSE/day05/src/com/lc/day05/constract06/TestStudent.java

@@ -0,0 +1,24 @@
+package com.lc.day05.constract06;
+
+/**
+ * ClassName: TestStudent
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/28 13:47
+ * @Version 1.0
+ */
+public class TestStudent {
+
+    public static void main(String[] args) {
+
+        /*
+        - 如果没有定义构造方法,系统将给出一个默认的无参数构造方法
+        - 如果定义了构造方法,系统将不再提供默认的构造方法
+        - 如果自定义了带参构造方法,还要使用无参数构造方法,就必须再写一个无参数构造方法
+         */
+
+        Student student = new Student();
+
+        Person person = new Person();
+    }
+}

+ 59 - 0
JavaSE/day05/src/com/lc/day05/constract07/Person.java

@@ -0,0 +1,59 @@
+package com.lc.day05.constract07;
+
+/**
+ * ClassName: Person
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/28 14:22
+ * @Version 1.0
+ */
+public class Person {
+
+    public String name;
+    public int age;
+    public char sex;
+    public double height;
+    public double weight;
+
+    public Person() {
+        System.out.println("无参数的");
+    }
+
+    /*
+        this()
+        this(参数)
+     */
+    public Person(String name, double weight) {
+        //其他属性 赋值
+        //this 调用  想要的默认值
+        //this();
+        this( name, weight , '女' );
+    }
+
+    public Person(String name, double weight, char sex) {
+        //this
+        this(name,1,sex,80,weight);
+    }
+
+    public Person(String name, int age, char sex, double height , double weight) {
+
+        this.name = name;
+        this.age = age;
+        this.sex = sex;
+        this.height = height;
+        this.weight = weight;
+    }
+
+
+    public String getInfo(){
+        return "Person{" +
+                "name='" + name + '\'' +
+                ", age=" + age +
+                ", sex=" + sex +
+                ", height=" + height +
+                ", weight=" + weight +
+                '}';
+    }
+
+
+}

+ 21 - 0
JavaSE/day05/src/com/lc/day05/constract07/TestPerson.java

@@ -0,0 +1,21 @@
+package com.lc.day05.constract07;
+
+/**
+ * ClassName: TestPerson
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/28 14:28
+ * @Version 1.0
+ */
+public class TestPerson {
+
+    public static void main(String[] args) {
+        //两个参数
+        Person person = new Person("凡凡",7.8);
+
+        // 里面所有的都赋值了
+        System.out.println(person.getInfo());
+
+
+    }
+}

+ 76 - 0
JavaSE/day05/src/com/lc/day05/fz08/Person.java

@@ -0,0 +1,76 @@
+package com.lc.day05.fz08;
+
+/**
+ * ClassName: Person
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/28 15:22
+ * @Version 1.0
+ */
+public class Person {
+    //成员变量私有化
+    // 第一步 用 private  修饰 除本类  其他位置不可以访问。
+    // 控制属性
+    private String name;
+
+    private int age; //年龄 赋值 -1 获取 是大于 150.
+
+//    public Person() {
+//    }
+    //私有化 构造 不让其他 类直接 创建 当前对象。
+    private Person() {
+    }
+
+    public Person(String name, int age) {
+
+        //校验 验证
+        checkAge(age);
+
+        this.name = name;
+        this.age = age;
+    }
+
+    //提供方法方式
+    public void  setName( String name ){
+        this.name = name;
+    }
+
+    public String  getName( ){
+        return name;
+    }
+
+    public void setAge(int a){
+        //健壮性
+        //验证逻辑
+        checkAge(a);
+    }
+
+    public int getAge(){
+        return age;
+    }
+
+
+    @Override
+    public String toString() {
+        return "Person{" +
+                "name='" + name + '\'' +
+                ", age=" + age +
+                '}';
+    }
+
+
+    //在类内部 重复调用的 代码 抽取成 私有方法
+    private void checkAge( int age )  {
+        if ( age > 0 && age < 150){
+            age = age;
+        }else{
+            //System.out.println("错误提示 年龄不符合");
+            //抛出异常
+            try {
+                throw new Exception("错误提示 年龄不符合");
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+        }
+    }
+}

+ 36 - 0
JavaSE/day05/src/com/lc/day05/fz08/TestPerson.java

@@ -0,0 +1,36 @@
+package com.lc.day05.fz08;
+
+/**
+ * ClassName: TestPerson
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/28 15:23
+ * @Version 1.0
+ */
+public class TestPerson {
+
+    public static void main(String[] args) {
+
+        Person person = new Person("zs",1);
+
+        //name 私有的
+        //person.name;
+        person.setName("坤坤");
+        // person.setAge(22);
+
+        System.out.println(person);
+
+        //age 不符合
+        person.setAge(-10);
+        System.out.println(person);
+
+
+        //私有测试
+        Person person1 = new Person("峰峰", -10);
+
+
+        //构造方法私有化
+        // 不可以使用无参的
+        //Person person2 = new Person();
+    }
+}

+ 46 - 0
JavaSE/day05/src/com/lc/day05/method01/MathTools.java

@@ -0,0 +1,46 @@
+package com.lc.day05.method01;
+
+/**
+ * ClassName: MathTools
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/28 9:28
+ * @Version 1.0
+ */
+public class MathTools {
+    /*
+    - 方法名称  必须相同。
+    - 其中参数  个数 ,类型  , 顺序  不同 构成重载。
+    - 返回值  不能当作重载的依据。
+     */
+
+//    public double add( int a , int b ){
+//        return a + b;
+//    }
+
+    /**
+     * 文档注释
+     * @param a int 类型值
+     * @param b
+     * @return double
+     */
+    //类型
+    public double add( byte a , int b ){
+        return a + b;
+    }
+
+    //个数
+    public double add( byte a , int b , int c ){
+        return a + b+ c;
+    }
+    //顺序
+    public double add( int a , byte b ){
+        return a + b;
+    }
+
+    //兼容
+    public double add( int a , double b ){
+        return a + b;
+    }
+
+}

+ 39 - 0
JavaSE/day05/src/com/lc/day05/method01/Test01.java

@@ -0,0 +1,39 @@
+package com.lc.day05.method01;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/28 9:28
+ * @Version 1.0
+ */
+public class Test01 {
+
+    /*
+    - 方法名称  必须相同。
+    - 其中参数  个数 ,类型  , 顺序  不同 构成重载。
+    - 返回值  不能当作重载的依据。
+     */
+    public static void main(String[] args) {
+        MathTools mathTools = new MathTools();
+
+        /*
+            重载调用
+            先根据个数 匹配  根据类型  寻找兼容的。
+         */
+
+        double add = mathTools.add((byte) 10, 10, 10);
+        System.out.println(add);
+
+        double add1 = mathTools.add( 10, 10);
+        System.out.println(add1);
+
+        //兼容
+        double add2 = mathTools.add( 10, 10);
+        System.out.println(add2);
+
+
+    }
+
+
+}

+ 30 - 0
JavaSE/day05/src/com/lc/day05/method02/Test01.java

@@ -0,0 +1,30 @@
+package com.lc.day05.method02;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/28 10:06
+ * @Version 1.0
+ */
+public class Test01 {
+    public static void main(String[] args) {
+        Test01 test01 = new Test01();
+
+        int a = 10;
+        int b = 20;
+
+        System.out.println("a:"+a); // 10
+        System.out.println("b:"+b); // 20
+
+        test01.swap( a , b );
+
+        System.out.println("a:"+a); // ? 20 10
+        System.out.println("b:"+b); // ? 40 20
+    }
+
+    public void swap( int a, int b ){
+        a = 20;
+        b = 40;
+    }
+}

+ 38 - 0
JavaSE/day05/src/com/lc/day05/method02/Test02.java

@@ -0,0 +1,38 @@
+package com.lc.day05.method02;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/28 10:06
+ * @Version 1.0
+ */
+public class Test02 {
+    public static void main(String[] args) {
+        Test02 test02 = new Test02();
+
+        Data d = new Data();
+        d.x = 10;
+        d.y = 20;
+        System.out.println(d);
+
+        System.out.println("x:"+d.x ); //10
+        System.out.println("y:"+d.y ); //20
+        //swap
+        test02.swap(d);
+        System.out.println("x:"+d.x ); //  ? 20
+        System.out.println("y:"+d.y ); //  ? 40
+    }
+
+    public void swap( Data d ){
+        System.out.println(d);
+        d.x = 20;
+        d.y = 40;
+    }
+}
+class Data{
+
+    int x = 0;
+    int y = 10;
+
+}

+ 33 - 0
JavaSE/day05/src/com/lc/day05/method02/Test03.java

@@ -0,0 +1,33 @@
+package com.lc.day05.method02;
+
+/**
+ * ClassName: Test03
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/28 10:40
+ * @Version 1.0
+ */
+public class Test03 {
+    public void swap(Data1 data){ // 0x1122
+        data = new Data1(); // 0x1133 x = 0 y = 0;
+        int temp = data.x;
+        data.x = data.y;
+        data.y = temp;
+    }
+    public static void main(String[] args) {
+        Test03 tools = new Test03();
+
+        Data1 data = new Data1(); // 0x1122
+        data.x = 10; //0x1122.x = 10
+        data.y = 20; // 0x1122.y = 20;
+        System.out.println("交换之前:x = " + data.x +",y = " + data.y);// 10,20
+        tools.swap(data);//调用完之后,x与y的值交换?
+        //0x1122
+        System.out.println("交换之后:x = " + data.x +",y = " + data.y);// 10, 20
+    }
+}
+
+class Data1{
+    int x ;
+    int y;
+}

+ 32 - 0
JavaSE/day05/src/com/lc/day05/method02/Test04.java

@@ -0,0 +1,32 @@
+package com.lc.day05.method02;
+
+/**
+ * ClassName: Test04
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/28 10:45
+ * @Version 1.0
+ */
+public class Test04 {
+    public static void main(String args[]) {
+        Test04 test = new Test04();
+        test.first();
+    }
+    public void first() {
+        int i = 10;
+        Value v = new Value();   //V.0x1122  i =35  = 15  = 25;
+        v.i = 15;
+        second(v, i); //0x1122
+        System.out.println(v.i); // 25
+    }
+    public void second(Value v, int i) { // 0x1122  10
+        i = 0;
+        v.i = 25;
+        Value val = new Value(); // 0x1133  i = 35;
+        v = val; // 0x1133
+        System.out.println(v.i + " " + i); // 35  0
+    }
+}
+class Value {
+    int i = 35;
+}

+ 52 - 0
JavaSE/day05/src/com/lc/day05/method03/Test05.java

@@ -0,0 +1,52 @@
+package com.lc.day05.method03;
+
+/**
+ * ClassName: Test05
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/28 11:10
+ * @Version 1.0
+ */
+public class Test05 {
+
+    public static void main(String[] args) {
+
+        //使用
+        Test05 test05 = new Test05();
+
+        int i = test05.addSum(1, 2, 3, 4, 5);//任意参数
+
+        System.out.println(i);
+
+
+        test05.addSum1(1,2);
+
+    }
+
+    /*
+    可变参数
+    多个数字的和
+     */
+
+    public int addSum ( int ... a ){
+        //数组
+        int sum = 0;
+        for (int i = 0; i < a.length; i++) {
+            sum+=a[i];
+        }
+        
+        return sum;
+    }
+
+    //可变参数本质是数组 不能重载。
+//    public int addSum ( int[] a ){
+//
+//    }
+
+    public int addSum1( int b ,int... a  ){
+
+        return 0;
+    }
+
+
+}

+ 37 - 0
JavaSE/day05/src/com/lc/day05/method04/Test06.java

@@ -0,0 +1,37 @@
+package com.lc.day05.method04;
+
+/**
+ * ClassName: Test06
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/28 11:20
+ * @Version 1.0
+ */
+public class Test06 {
+
+    public static void main(String[] args) {
+        Test06 test06 = new Test06();
+
+        //test06.aVoid(); //StackOverflowError
+
+        //test06.bVoid();
+
+    }
+    //间接递归
+    public void  bVoid(){
+        cVoid();
+    }
+
+    public void  cVoid(){
+        dVoid();
+    }
+
+    public void  dVoid(){
+        bVoid();
+    }
+
+    //直接递归
+    public void  aVoid(){
+        aVoid();
+    }
+}

+ 34 - 0
JavaSE/day05/src/com/lc/day05/method04/Test07.java

@@ -0,0 +1,34 @@
+package com.lc.day05.method04;
+
+/**
+ * ClassName: Test06
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/28 11:20
+ * @Version 1.0
+ */
+public class Test07 {
+
+    public static void main(String[] args) {
+        // 计算  5 - 1 和
+        // 计算  4 和
+        // 计算  3
+        // 。。。。
+        // 出口  1  return  1;
+        Test07 t = new Test07();
+        int sum = t.getSum(5);
+        System.out.println(sum);
+
+    }
+
+    //求和  1-5;
+    public int getSum( int n ){
+        if ( n == 1 ){
+            return 1;
+        }
+        return n + getSum(n-1);
+    }
+
+
+
+}

+ 11 - 0
JavaSE/day06/day06.iml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 22 - 0
JavaSE/day06/src/com/lc/day06/extends01/Animal.java

@@ -0,0 +1,22 @@
+package com.lc.day06.extends01;
+
+/**
+ * ClassName: Animal
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/29 10:04
+ * @Version 1.0
+ */
+public class Animal {
+    String name;
+    int age;
+
+    //方法
+    public void eat(){
+        System.out.println("name:"+name+" eating");
+    }
+
+    public void sleep(){
+        System.out.println("name:"+name+" sleeping");
+    }
+}

+ 19 - 0
JavaSE/day06/src/com/lc/day06/extends01/Cat.java

@@ -0,0 +1,19 @@
+package com.lc.day06.extends01;
+
+/**
+ * ClassName: Cat
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/29 10:05
+ * @Version 1.0
+ */
+public class Cat extends Animal {
+
+    String name;
+
+    // 特有的
+    public void catchMouse(){
+        System.out.println("name:"+name+" catchMouse");
+    }
+
+}

+ 17 - 0
JavaSE/day06/src/com/lc/day06/extends01/Dog.java

@@ -0,0 +1,17 @@
+package com.lc.day06.extends01;
+
+/**
+ * ClassName: Dog
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/29 10:05
+ * @Version 1.0
+ */
+public class Dog extends Animal {
+
+
+    // 特有的
+    public void lookHome(){
+        System.out.println("name:"+name+" lookHome");
+    }
+}

+ 34 - 0
JavaSE/day06/src/com/lc/day06/extends01/Test01.java

@@ -0,0 +1,34 @@
+package com.lc.day06.extends01;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/29 10:09
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) {
+
+        Dog dog = new Dog();
+        dog.name = "二哈";
+        dog.age = 1;
+
+        dog.eat();
+        dog.lookHome();
+
+
+        Cat cat = new Cat();
+
+        cat.name ="加菲猫"; // 不推荐 使用 阿里 手册中 不可以使用 同名属性。
+
+        cat.eat();
+        cat.catchMouse();
+
+        //抽取到父类。
+        //类增加  简单 可扩展 可维护  提高。
+
+    }
+
+}

+ 47 - 0
JavaSE/day06/src/com/lc/day06/extends02/Test01.java

@@ -0,0 +1,47 @@
+package com.lc.day06.extends02;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/29 10:56
+ * @Version 1.0
+ */
+public class Test01 {
+    public static void main(String[] args) {
+        C c = new C();
+        //c.a;
+
+        //c.aVoid();
+        //构造方法不能被继承
+        //C c1 = new A();
+    }
+}
+
+
+//继承 单继承
+//支持 多层继承  属性 和 方法都是可以使用
+
+class A {
+    int a;
+
+    private int b;
+
+    public A(int a) {
+        this.a = a;
+    }
+
+    public A() {
+    }
+
+    public void aVoid(){
+
+    }
+}
+class B extends A {
+
+
+}
+class C extends B  {
+    //int a;
+}

+ 26 - 0
JavaSE/day06/src/com/lc/day06/extends03override/Car.java

@@ -0,0 +1,26 @@
+package com.lc.day06.extends03override;
+
+/**
+ * ClassName: Car
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/29 11:09
+ * @Version 1.0
+ */
+public class Car {
+
+    String name;
+    /*
+        启动
+     */
+    public void start(){
+        System.out.println("    踩离合\n" +
+                "    踩刹车\n" +
+                "    用户钥匙启动");
+    }
+
+
+    public void run(){
+        System.out.println("  正常行驶");
+    }
+}

+ 36 - 0
JavaSE/day06/src/com/lc/day06/extends03override/SmartCar.java

@@ -0,0 +1,36 @@
+package com.lc.day06.extends03override;
+
+import com.lc.day06.extends01.Cat;
+
+import java.sql.SQLOutput;
+
+/**
+ * ClassName: Car
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/29 11:09
+ * @Version 1.0
+ */
+public class SmartCar extends Car {
+
+    public void start(){
+        System.out.println("踩刹车");
+        System.out.println(name+"一键启动");
+    }
+
+
+    //标识 注解 是一个重写的方法 @Override
+    //不是重写的方法 不可以添加注解@Override
+    @Override
+    public void run(){
+
+        System.out.println(name+"自动驾驶");
+        System.out.println("l3辅助行驶");
+        System.out.println("自动跟车");
+
+    }
+
+//    @Override
+//    public void run1(){}
+
+}

+ 23 - 0
JavaSE/day06/src/com/lc/day06/extends03override/Test.java

@@ -0,0 +1,23 @@
+package com.lc.day06.extends03override;
+
+/**
+ * ClassName: Test
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/29 11:11
+ * @Version 1.0
+ */
+public class Test {
+
+    public static void main(String[] args) {
+
+        SmartCar car = new SmartCar();
+        car.name = "特斯拉";
+
+        car.start();
+        car.run();
+
+        // 重写过后
+        // 调用方法 一定是 子类重写过的。
+    }
+}

+ 65 - 0
JavaSE/day06/src/com/lc/day06/extends04override/Test.java

@@ -0,0 +1,65 @@
+package com.lc.day06.extends04override;
+
+/**
+ * ClassName: Test
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/29 11:35
+ * @Version 1.0
+ */
+public class Test {
+}
+
+class Father{
+
+}
+
+class A extends Father{
+
+    //方法重写时, 方法名与形参列表必须一致。
+    public void m1( int a ){
+
+    }
+
+    // public > protected >  默认的  > 私有的
+
+    //方法重写时,子类的权限修饰符必须要大于或者等于父类的权限修饰符。
+    public void m2(){
+
+    }
+
+    //方法重写时,子类的返回值类型必须要小于或者 等于父类的返回值类型(基本类型 返回值类型相同 )。
+    // 基本 必须一致
+    // B 继承  A  类型范围   B 属于 A 类型。
+    public double m3(){
+
+        return 1;
+    }
+
+    public A m4(){
+
+        return null;
+    }
+}
+class B extends A{
+
+    @Override
+    public void m1( int a ){
+
+    }
+
+    @Override
+    public void m2(){
+
+    }
+
+    public double m3(){
+
+        return 1;
+    }
+//    public Father m4(){
+//
+//        return null;
+//    }
+
+}

+ 21 - 0
JavaSE/day06/src/com/lc/day06/triangle/Exer01.java

@@ -0,0 +1,21 @@
+package com.lc.day06.triangle;
+
+/**
+ * ClassName: Exer01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/29 9:21
+ * @Version 1.0
+ */
+public class Exer01 {
+
+    public static void main(String[] args) {
+
+        Triangle triangle = new Triangle();
+        triangle.setBases(10, 40 , 40);
+
+        double area = triangle.area();
+
+        System.out.println(triangle.getInfo());
+    }
+}

+ 73 - 0
JavaSE/day06/src/com/lc/day06/triangle/Triangle.java

@@ -0,0 +1,73 @@
+package com.lc.day06.triangle;
+
+/**
+ * ClassName: Triangle
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/29 9:21
+ * @Version 1.0
+ */
+public class Triangle {
+
+    private double a,b,c;
+
+
+    public double getA() {
+        return a;
+    }
+
+    public double getB() {
+        return b;
+    }
+
+    public double getC() {
+        return c;
+    }
+
+    public double area(){
+        if (a == 0 || b == 0 || c == 0  ){
+            System.out.println("请设置 边长!");
+            return -1;
+        }
+
+        double p = (a + b + c) /2;
+
+        return Math.sqrt( p *(p -a) * (p-b) * (p-c) );
+    }
+
+    public void setBases(double a, double b, double c){
+        //校验
+        boolean flag = checkeABC(a,b,c);
+        if (flag){
+            this.a = a;
+            this.b = b;
+            this.c = c;
+        }else {
+            System.out.println("不符合三角形!!");
+
+        }
+    }
+
+    private boolean checkeABC(double a, double b, double c){
+        //每个边大于零
+        if (a < 0 || b < 0 ||  c < 0  ){
+            return false;
+        }
+
+        //两边之和 大于 第三边
+        if ( a + b < c || a + c < b || b + c < a ){
+            return false;
+        }
+        return true;
+    }
+
+
+    public String getInfo() {
+        return "Triangle{" +
+                "a=" + a +
+                ", b=" + b +
+                ", c=" + c +
+                "面积:"+ area()+
+                '}';
+    }
+}

+ 11 - 0
JavaSE/day07-polymorphic/day07-polymorphic.iml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 17 - 0
JavaSE/day07-polymorphic/src/com/lc/abstract01/Animal.java

@@ -0,0 +1,17 @@
+package com.lc.abstract01;
+
+/**
+ * ClassName: Animal
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 15:26
+ * @Version 1.0
+ */
+
+//抽象类
+public abstract class Animal {
+
+    //抽象方法
+    public abstract void run( Food food );
+
+}

+ 19 - 0
JavaSE/day07-polymorphic/src/com/lc/abstract01/Cat.java

@@ -0,0 +1,19 @@
+package com.lc.abstract01;
+
+/**
+ * ClassName: Cat
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 15:36
+ * @Version 1.0
+ */
+public class Cat extends Animal{
+    @Override
+    public void run(Food food) {
+        if ( food instanceof MaoLiang ){
+            System.out.println("消耗猫粮");
+        }else{
+            System.out.println("没有吃的 跑不动了");
+        }
+    }
+}

+ 21 - 0
JavaSE/day07-polymorphic/src/com/lc/abstract01/Dog.java

@@ -0,0 +1,21 @@
+package com.lc.abstract01;
+
+/**
+ * ClassName: Dog
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 15:30
+ * @Version 1.0
+ */
+public class Dog extends Animal {
+    //重写方法 按照父类定义的方法 实现。
+
+    @Override
+    public void run(Food food) {
+        if ( food instanceof GouLiang ){
+            System.out.println("消耗狗粮");
+        }else{
+            System.out.println("没有吃的 跑不动了");
+        }
+    }
+}

+ 11 - 0
JavaSE/day07-polymorphic/src/com/lc/abstract01/Food.java

@@ -0,0 +1,11 @@
+package com.lc.abstract01;
+
+/**
+ * ClassName: Food
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 15:35
+ * @Version 1.0
+ */
+public class Food {
+}

+ 11 - 0
JavaSE/day07-polymorphic/src/com/lc/abstract01/GouLiang.java

@@ -0,0 +1,11 @@
+package com.lc.abstract01;
+
+/**
+ * ClassName: GouLiang
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 15:36
+ * @Version 1.0
+ */
+public class GouLiang  extends Food{
+}

+ 11 - 0
JavaSE/day07-polymorphic/src/com/lc/abstract01/MaoLiang.java

@@ -0,0 +1,11 @@
+package com.lc.abstract01;
+
+/**
+ * ClassName: MaoLiang
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 15:37
+ * @Version 1.0
+ */
+public class MaoLiang extends Food{
+}

+ 31 - 0
JavaSE/day07-polymorphic/src/com/lc/abstract01/Test.java

@@ -0,0 +1,31 @@
+package com.lc.abstract01;
+
+/**
+ * ClassName: Test
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 15:40
+ * @Version 1.0
+ */
+public class Test {
+
+    public static void main(String[] args) {
+
+        //抽象类使用
+        Animal a1 = new Cat();
+        MaoLiang maoLiang = new MaoLiang();
+        a1.run(maoLiang);
+
+
+        Animal a2 = new Dog();
+        GouLiang gouLiang = new GouLiang();
+        a2.run(gouLiang);
+
+        //
+        a1.run(gouLiang);
+
+
+
+
+    }
+}

+ 78 - 0
JavaSE/day07-polymorphic/src/com/lc/abstract02/Test01.java

@@ -0,0 +1,78 @@
+package com.lc.abstract02;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 16:24
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) {
+        //抽象类**不能创建对象**
+        //A a = new A();
+
+        //创建子类
+//        A a = new A() {
+//            @Override
+//            void a() {
+//
+//            }
+//        };
+
+
+    }
+}
+abstract class  A {
+
+    int a;
+    abstract void a();
+
+    public A(int a) {
+        this.a = a;
+    }
+}
+
+class B extends A {
+
+    //默认构造
+    public B( int a ){
+        super(a); //抽象类中,也有构造方法,是供子类创建对象时,初始化父类成员变量使用的
+    }
+
+    @Override
+    void a() {
+
+    }
+}
+//抽象类中,不一定包含抽象方法,但是有抽象方法的类必定是抽象类
+abstract class  C {
+    public void c(){
+
+    }
+}
+
+class   D{
+   // abstract void d();
+}
+
+//抽象类的子类,必须重写抽象父类中**所有的**抽象方法,否则,编译无法通过而报错。除非该子类也是抽象类。
+class E extends A {
+
+    public E(int a) {
+        super(a);
+    }
+
+    @Override
+    void a() {
+
+    }
+}
+
+abstract class F extends A {
+
+    public F(int a) {
+        super(a);
+    }
+}

+ 55 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic01/Test01.java

@@ -0,0 +1,55 @@
+package com.lc.polymorphic01;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 9:17
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) {
+
+        A a = new A();
+        B b = new B();
+
+//        if (b instanceof A){ // 没有继承继
+//            System.out.println("AAA");
+//        }
+        //重载
+        //多态
+        System.out.println(b );
+
+        Object x = new A();
+        //Object x = new B();
+
+
+
+        if ( x instanceof A ){
+            System.out.println("A");
+        }
+
+        if (x instanceof Object){
+            System.out.println("O");
+        }
+
+        // x 类型是多种  由于 A 继承 Object   必有继承
+        // 声明类型为 父类 类型  new 子类对象。 多态使用。
+
+
+        //重载
+        System.out.println(1);
+        System.out.println(1.1);
+        System.out.println(true);
+
+    }
+
+}
+class A {
+
+}
+
+class B {
+
+}

+ 16 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic02/Animal.java

@@ -0,0 +1,16 @@
+package com.lc.polymorphic02;
+
+/**
+ * ClassName: Animal
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 9:30
+ * @Version 1.0
+ */
+public class Animal {
+
+    public void eat(){
+        System.out.println("eat");
+    }
+
+}

+ 17 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic02/Cat.java

@@ -0,0 +1,17 @@
+package com.lc.polymorphic02;
+
+/**
+ * ClassName: Cat
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 9:31
+ * @Version 1.0
+ */
+public class Cat extends Animal{
+
+
+    @Override
+    public void eat() {
+        System.out.println("Cat吃小鱼干");
+    }
+}

+ 16 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic02/Dog.java

@@ -0,0 +1,16 @@
+package com.lc.polymorphic02;
+
+/**
+ * ClassName: Dog
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 9:31
+ * @Version 1.0
+ */
+public class Dog  extends Animal {
+
+    @Override
+    public void eat() {
+        System.out.println("Dog吃狗粮");
+    }
+}

+ 35 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic02/Test.java

@@ -0,0 +1,35 @@
+package com.lc.polymorphic02;
+
+/**
+ * ClassName: Test
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 9:31
+ * @Version 1.0
+ */
+public class Test {
+    public static void main(String[] args) {
+        //多态格式
+        Animal a1 = new Cat();
+
+        Animal a2 = new Dog();
+
+        //没有重写 没有意义
+//        a1.eat();
+//        a2.eat();
+
+        //有重写
+        // 同一个行为 不同体现
+        a1.eat();
+        a2.eat();
+
+        // 类型为 子类 也可以 父类类型。
+
+        //所有类 都可以用 Object 接收。 OBject 是 所有类的父类。
+        //Object a3 = new Cat();
+
+
+
+
+    }
+}

+ 18 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic03/Animal.java

@@ -0,0 +1,18 @@
+package com.lc.polymorphic03;
+
+/**
+ * ClassName: Animal
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 9:30
+ * @Version 1.0
+ */
+public class Animal {
+
+    int a = 10;
+
+    public void eat(){
+        System.out.println("eat");
+    }
+
+}

+ 23 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic03/Cat.java

@@ -0,0 +1,23 @@
+package com.lc.polymorphic03;
+
+/**
+ * ClassName: Cat
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 9:31
+ * @Version 1.0
+ */
+public class Cat extends Animal {
+
+    int a = 20;
+
+    @Override
+    public void eat() {
+        System.out.println("Cat吃小鱼干");
+    }
+
+
+    public void catchMouse(){
+        System.out.println("Cat抓耗子");
+    }
+}

+ 24 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic03/Test.java

@@ -0,0 +1,24 @@
+package com.lc.polymorphic03;
+
+/**
+ * ClassName: Test
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 9:31
+ * @Version 1.0
+ */
+public class Test {
+    public static void main(String[] args) {
+        //多态格式
+        Animal a1 = new Cat();
+
+        //a1 不能调用 抓耗子。
+        //a1 可以 eat 在父类中有声明
+        a1.eat();
+
+        //成员变量 编译运行 都看父类。
+        System.out.println(a1.a);
+
+
+    }
+}

+ 12 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic04/Animal.java

@@ -0,0 +1,12 @@
+package com.lc.polymorphic04;
+
+/**
+ * ClassName: Animal
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 9:49
+ * @Version 1.0
+ */
+public class Animal {
+
+}

+ 11 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic04/Cat.java

@@ -0,0 +1,11 @@
+package com.lc.polymorphic04;
+
+/**
+ * ClassName: Cat
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 9:49
+ * @Version 1.0
+ */
+public class Cat extends Animal{
+}

+ 11 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic04/Dog.java

@@ -0,0 +1,11 @@
+package com.lc.polymorphic04;
+
+/**
+ * ClassName: Dog
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 9:49
+ * @Version 1.0
+ */
+public class Dog extends Animal{
+}

+ 28 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic04/Pet.java

@@ -0,0 +1,28 @@
+package com.lc.polymorphic04;
+
+/**
+ * ClassName: Pet
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 9:49
+ * @Version 1.0
+ */
+public class Pet {
+
+    static int count;
+    static Animal[] animals = new Animal[10];
+
+    // 多态作为参数
+    //送养方法
+    // 通用的方法
+    // 子类可以是 父类类型
+    public static void foster( Animal dog ){
+        animals[count] = dog;
+        count++;
+    }
+
+
+
+
+
+}

+ 32 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic04/Test01.java

@@ -0,0 +1,32 @@
+package com.lc.polymorphic04;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 9:49
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) {
+        //狗
+        Dog dog = new Dog();
+
+
+        //猫
+        Cat cat = new Cat();
+        //寄养 多态参数
+
+        Pet.foster(dog);
+        Pet.foster(cat);
+
+
+        //查看
+        for (int i = 0; i < Pet.animals.length; i++) {
+            System.out.println(Pet.animals[i]);
+        }
+
+
+    }
+}

+ 23 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic05/Apple.java

@@ -0,0 +1,23 @@
+package com.lc.polymorphic05;
+
+/**
+ * ClassName: Apple
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 10:42
+ * @Version 1.0
+ */
+public class Apple extends Fruit{
+
+    public Apple() {
+    }
+
+    public Apple(String name) {
+        super(name);
+    }
+
+    @Override
+    public void showTaste() {
+        System.out.println("很甜 很脆");
+    }
+}

+ 38 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic05/Fruit.java

@@ -0,0 +1,38 @@
+package com.lc.polymorphic05;
+
+/**
+ * ClassName: Fruit
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 10:40
+ * @Version 1.0
+ */
+public class Fruit {
+    private String name;
+
+    public Fruit() {
+    }
+
+    public Fruit(String name) {
+        this.name = name;
+    }
+
+    //showTaste
+    public void showTaste(){}
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+
+    @Override
+    public String toString() {
+        return "Fruit{" +
+                "name='" + name + '\'' +
+                '}';
+    }
+}

+ 20 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic05/Ginseng.java

@@ -0,0 +1,20 @@
+package com.lc.polymorphic05;
+
+/**
+ * ClassName: Ginseng
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 10:43
+ * @Version 1.0
+ */
+public class Ginseng extends Fruit{
+
+    public Ginseng(String name) {
+        super(name);
+    }
+
+    @Override
+    public void showTaste() {
+        System.out.println("深水炸弹 甜");
+    }
+}

+ 50 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic05/Orchard.java

@@ -0,0 +1,50 @@
+package com.lc.polymorphic05;
+
+/**
+ * ClassName: Orchard
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 10:44
+ * @Version 1.0
+ */
+public class Orchard {
+
+    static int count;
+
+    static Fruit[] fruits = new Fruit[10];
+
+    public static void plantingFruit( Fruit fruit ){
+        fruits[count] = fruit;
+        count++;
+    }
+
+    //摘水果
+    public static Fruit getFruit( int index ){
+        /*
+            原数组
+            原数组索引
+            新数组
+            新数组 索引
+            元素个数
+            [1,2,3,4,5]
+            [1,3]
+         */
+
+        //删除
+        System.arraycopy(fruits,index+1,fruits,index,count-(index));
+
+        // 置为null 需要调换位置
+
+        return fruits[index] ;
+    }
+
+    public static Fruit getFruit1( int index ){
+        if (index == 1){
+            return new Apple("苹果");
+        }else{
+            return new Ginseng("人参果");
+        }
+    }
+
+
+}

+ 43 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic05/Test.java

@@ -0,0 +1,43 @@
+package com.lc.polymorphic05;
+
+/**
+ * ClassName: Test
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 10:46
+ * @Version 1.0
+ */
+public class Test {
+    public static void main(String[] args) {
+
+        Fruit f1 = new Apple("苹果1");
+        Fruit f2 = new Ginseng("人参果");
+        Fruit f3 = new Apple("苹果2");
+
+        Orchard.plantingFruit(f1);
+        Orchard.plantingFruit(f2);
+        Orchard.plantingFruit(f3);
+
+        for (int i = 0; i < Orchard.count; i++) {
+            System.out.println(Orchard.fruits[i]);
+
+            //展示
+            Orchard.fruits[i].showTaste();
+        }
+
+        System.out.println("-------------");
+        //获取
+        Fruit fruit = Orchard.getFruit(1);
+
+        System.out.println(fruit);
+        System.out.println("------------");
+        for (int i = 0; i < Orchard.fruits.length; i++) {
+            System.out.println(Orchard.fruits[i]);
+        }
+
+
+        System.out.println("---------");
+        Fruit fruit1 = Orchard.getFruit1(2);
+        System.out.println(fruit1);
+    }
+}

+ 33 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic05/Test01.java

@@ -0,0 +1,33 @@
+package com.lc.polymorphic05;
+
+
+import java.util.Arrays;
+
+/**
+ * ClassName: Test
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 10:46
+ * @Version 1.0
+ */
+public class Test01 {
+    public static void main(String[] args) {
+        Integer[] arr1 = {1,2,3,4,5,6};
+
+        //{1,2,3,4,5,6};  {3,4,5,6,5,6};
+        //复制数组
+        /*
+             /*
+            原数组
+            原数组索引 开始
+            新数组
+            新数组 索引
+            元素个数
+
+         */
+         System.arraycopy(arr1,2 , arr1 , 1 , 4);
+
+        System.out.println(Arrays.toString(arr1));
+
+    }
+}

+ 11 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic06/Animal.java

@@ -0,0 +1,11 @@
+package com.lc.polymorphic06;
+
+/**
+ * ClassName: Animal
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 13:40
+ * @Version 1.0
+ */
+public class Animal {
+}

+ 11 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic06/Cat.java

@@ -0,0 +1,11 @@
+package com.lc.polymorphic06;
+
+/**
+ * ClassName: Cat
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 13:45
+ * @Version 1.0
+ */
+public class Cat extends Animal{
+}

+ 16 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic06/Dog.java

@@ -0,0 +1,16 @@
+package com.lc.polymorphic06;
+
+/**
+ * ClassName: Dog
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 13:41
+ * @Version 1.0
+ */
+public class Dog  extends Animal{
+
+    public void lookHome(){
+        System.out.println("小狗看家");
+    }
+
+}

+ 43 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic06/Test01.java

@@ -0,0 +1,43 @@
+package com.lc.polymorphic06;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 13:41
+ * @Version 1.0
+ */
+public class Test01 {
+    public static void main(String[] args) {
+        //类型提升
+        Animal dog = new Dog();
+
+
+        //instanceof检查
+
+//        if (dog instanceof Dog){
+//            //强制转换
+//            Dog dog2 = (Dog) dog;
+//            dog2.lookHome();
+//        }
+
+
+        //强制转换
+        if (dog instanceof Cat){
+            Cat dog2 = (Cat) dog;
+        }
+
+        //类型转换异常  ClassCastException
+        // Dog cannot be cast to class com.lc.polymorphic06.Cat
+
+
+
+
+        //自动转换
+//        Dog dog1 = new Dog();
+//        Animal animal = dog1;
+//        //dog1.lookHome(); //特有
+
+
+    }
+}

+ 49 - 0
JavaSE/day07-polymorphic/src/com/lc/polymorphic06/Test02.java

@@ -0,0 +1,49 @@
+package com.lc.polymorphic06;
+
+/**
+ * ClassName: Test02
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/4 13:51
+ * @Version 1.0
+ */
+public class Test02 {
+    public static void main(String[] args) {
+        A a1 = new A(); //A
+        A a2 = new B(); // 多态
+        B b = new B();
+        C c = new C();
+        D d = new D();
+        System.out.println("(1)" + a1.show(b)); //  a and a
+        System.out.println("(2)" + a2.show(d)); //  b     A
+        System.out.println("(3)" + b.show(c));  //  a     c
+        System.out.println("(4)" + b.show(d));  //  b     b
+    }
+}
+class A {
+    public String show(C obj) {
+        return ("A and C");
+    }
+    public String show(A obj) {
+        return "A and A";
+    }
+}
+
+class B extends A {
+
+    //继承
+//    public String show(C obj) {
+//        return ("A and C");
+//    }
+
+    public String show(B obj) {
+        return "B and B";
+    }
+
+    @Override
+    public String show(A obj) {
+        return "B and A";
+    }
+}
+class C extends B { }
+class D extends B { }

+ 11 - 0
JavaSE/day08-interface/day08-interface.iml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 30 - 0
JavaSE/day08-interface/src/com/lc/day08/interface01/BYDCar.java

@@ -0,0 +1,30 @@
+package com.lc.day08.interface01;
+
+/**
+ * ClassName: BYDCar
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/5 9:44
+ * @Version 1.0
+ */
+public class BYDCar implements CarIntegerface {
+    @Override
+    public void run(int i) {
+        if ( i >= MAX_SPEED ){
+            System.out.println("开始报警  超速了 超速了 ");
+        }else {
+            System.out.println("正常行驶");
+        }
+    }
+
+    @Override
+    public int brake() {
+        int b = (int) (Math.random()*10) + 45;
+        if (b >= MIN_DISTANCE){
+            System.out.println("刹车距离过长,不符合要求");
+        }else{
+            System.out.println("刹车距离,符合要求");
+        }
+        return b;
+    }
+}

+ 45 - 0
JavaSE/day08-interface/src/com/lc/day08/interface01/CarIntegerface.java

@@ -0,0 +1,45 @@
+package com.lc.day08.interface01;
+
+/**
+ * ClassName: CarIntegerface
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/5 9:34
+ * @Version 1.0
+ */
+
+//接口声明
+public interface CarIntegerface {
+
+    //常量
+    public static final  int MAX_SPEED = 200;//km / h
+
+    //刹车举例
+    int MIN_DISTANCE = 50;//100 km / h
+
+    //运行
+    public void run( int i );
+    //刹车
+    public int brake();
+
+
+    //默认方法
+    default void start(){
+        System.out.println("启动");
+
+        info();
+    }
+
+    //静态方法
+    static void end(){
+        System.out.println("停止");
+    }
+
+    //私有方法
+    private void  info(){
+        System.out.println("比亚迪 构建你的梦想");
+    }
+
+
+
+}

+ 11 - 0
JavaSE/day08-interface/src/com/lc/day08/interface01/Fuel.java

@@ -0,0 +1,11 @@
+package com.lc.day08.interface01;
+
+/**
+ * ClassName: Fuel
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/5 9:39
+ * @Version 1.0
+ */
+public class Fuel {
+}

+ 28 - 0
JavaSE/day08-interface/src/com/lc/day08/interface01/Test.java

@@ -0,0 +1,28 @@
+package com.lc.day08.interface01;
+
+/**
+ * ClassName: Test
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/5 9:32
+ * @Version 1.0
+ */
+public class Test {
+
+    public static void main(String[] args) {
+
+        //使用多态
+        CarIntegerface car = new BYDCar();
+
+        car.start();
+        car.run(201);
+        int brake = car.brake();
+        System.out.println("刹车距离:"+brake);
+
+        //类名.方法名
+        CarIntegerface.end();
+
+
+
+    }
+}

+ 57 - 0
JavaSE/day08-interface/src/com/lc/day08/interface02/Test01.java

@@ -0,0 +1,57 @@
+package com.lc.day08.interface02;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/5 10:53
+ * @Version 1.0
+ */
+public class Test01 {
+
+
+    public static void main(String[] args) {
+
+        C  h = new H();
+
+
+
+
+    }
+}
+interface A {
+    void a();
+}
+
+interface B {
+    void b();
+}
+
+interface C extends A, B {
+
+}
+
+class F implements A , B{
+
+    @Override
+    public void a() {
+        //类实现接口(implements 实现抽象方法,
+    }
+
+    @Override
+    public void b() {
+        //接口的多实现(implements
+    }
+}
+class H implements C{
+
+    @Override
+    public void a() {
+
+    }
+
+    @Override
+    public void b() {
+
+    }
+}

+ 15 - 0
JavaSE/day08-interface/src/com/lc/day08/interface03/B.java

@@ -0,0 +1,15 @@
+package com.lc.day08.interface03;
+
+/**
+ * ClassName: B
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/5 11:10
+ * @Version 1.0
+ */
+public interface B extends FlyInterface{
+    @Override
+    default void show() {
+        FlyInterface.super.show();
+    }
+}

+ 18 - 0
JavaSE/day08-interface/src/com/lc/day08/interface03/Father.java

@@ -0,0 +1,18 @@
+package com.lc.day08.interface03;
+
+
+/**
+ * ClassName: Father
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/5 10:59
+ * @Version 1.0
+ */
+public class Father {
+
+    public static final int A = 10;
+
+    public void show() {
+        System.out.println("Father");
+    }
+}

+ 20 - 0
JavaSE/day08-interface/src/com/lc/day08/interface03/FlyInterface.java

@@ -0,0 +1,20 @@
+package com.lc.day08.interface03;
+
+/**
+ * ClassName: FlyInterface
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/5 10:59
+ * @Version 1.0
+ */
+public interface FlyInterface {
+
+    public static final int A = 10;
+
+    void fly();
+
+
+    default void show(){
+        System.out.println("FlyInterface");
+    }
+}

+ 33 - 0
JavaSE/day08-interface/src/com/lc/day08/interface03/Son.java

@@ -0,0 +1,33 @@
+package com.lc.day08.interface03;
+
+
+/**
+ * ClassName: Son
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/5 10:59
+ * @Version 1.0
+ */
+public class Son extends Father implements FlyInterface , Swimming{
+    @Override
+    public void fly() {
+        System.out.println("飞飞");
+    }
+
+    @Override
+    public void show() { //类种重写 可以不写 default
+        //手动指定  接口名.super.方法。
+        Swimming.super.show();
+
+        //调用常量
+        //通过接口
+        System.out.println(Swimming.A);
+        System.out.println(FlyInterface.A);
+
+        //父类
+        System.out.println(super.A);
+
+    }
+
+
+}

+ 17 - 0
JavaSE/day08-interface/src/com/lc/day08/interface03/Swimming.java

@@ -0,0 +1,17 @@
+package com.lc.day08.interface03;
+
+/**
+ * ClassName: Swimming
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/5 11:04
+ * @Version 1.0
+ */
+public interface Swimming {
+
+    public static final int A = 10;
+
+    default void show(){
+        System.out.println("Swimming");
+    }
+}

+ 18 - 0
JavaSE/day08-interface/src/com/lc/day08/interface03/Test01.java

@@ -0,0 +1,18 @@
+package com.lc.day08.interface03;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/5 11:01
+ * @Version 1.0
+ */
+public class Test01 {
+    public static void main(String[] args) {
+
+        Son son = new Son();
+        //类优先
+        son.show();
+
+    }
+}

+ 25 - 0
JavaSE/day08-interface/src/com/lc/day08/interface04/MyComparator.java

@@ -0,0 +1,25 @@
+package com.lc.day08.interface04;
+
+import java.util.Comparator;
+
+/**
+ * ClassName: MyComparator
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/5 14:50
+ * @Version 1.0
+ */
+public class MyComparator implements Comparator {
+    @Override
+    public int compare(Object o1, Object o2) {
+        //定义规则
+        //强转
+        Person p1 = (Person) o1;
+        Person p2 = (Person) o2;
+
+        //按照姓名
+        int i = p1.getName().compareTo(p2.getName());
+        //年龄
+        return i == 0 ? p1.getAge() - p2.getAge() : i;
+    }
+}

+ 60 - 0
JavaSE/day08-interface/src/com/lc/day08/interface04/Person.java

@@ -0,0 +1,60 @@
+package com.lc.day08.interface04;
+
+/**
+ * ClassName: Person
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/5 13:51
+ * @Version 1.0
+ */
+public class Person implements Comparable {
+
+    private String name;
+    private int age;
+
+    public Person() {
+    }
+
+    public Person(String name, int age) {
+        this.name = name;
+        this.age = age;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public int getAge() {
+        return age;
+    }
+
+    public void setAge(int age) {
+        this.age = age;
+    }
+
+    @Override
+    public int compareTo(Object o) {
+        //转换
+        Person p1 = (Person) o;
+
+        //年龄排序
+        int resuslt = this.age - p1.age;
+        //年龄相同 姓名排序
+        return resuslt == 0 ? this.name.compareTo(p1.name) : resuslt ;
+    }
+
+
+    @Override
+    public String toString() {
+        return "Person{" +
+                "name='" + name + '\'' +
+                ", age=" + age +
+                '}';
+    }
+
+
+}

+ 49 - 0
JavaSE/day08-interface/src/com/lc/day08/interface04/Test01.java

@@ -0,0 +1,49 @@
+package com.lc.day08.interface04;
+
+import java.util.Arrays;
+import java.util.Comparator;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/5 13:52
+ * @Version 1.0
+ */
+public class Test01 {
+    public static void main(String[] args) {
+
+        Person[] people = new Person[5];
+
+        people[0] = new Person("a",10);
+        people[1] = new Person("a",9);
+        people[2] = new Person("f",11);
+        people[3] = new Person("b",16);
+        people[4] = new Person("d",7);
+
+        //排序
+        Arrays.sort(people);
+        // ClassCastException  Person cannot be cast to class java.lang.Comparable
+
+        //lambda
+        Arrays.stream(people).forEach(System.out::println);
+
+
+
+        //String 实现了接口
+        String[] strings = {"a","c","b"};
+
+        Arrays.sort(strings);
+
+        System.out.println(Arrays.toString(strings));
+
+
+        // 比较器排序
+        // 在使用的时候  传入一个比较规则。
+        Arrays.sort(people, new MyComparator() );
+
+        //lambda
+        Arrays.stream(people).forEach(System.out::println);
+
+    }
+}

+ 49 - 0
JavaSE/day08-interface/src/com/lc/day08/interface05/ArrayTools.java

@@ -0,0 +1,49 @@
+package com.lc.day08.interface05;
+
+import java.util.Comparator;
+
+/**
+ * ClassName: ArrayTools
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/5 15:30
+ * @Version 1.0
+ */
+public class ArrayTools {
+
+    public static void sort(Object[] arr){
+
+        //冒泡
+        for (int i = 0; i < arr.length-1; i++) {
+            for (int k = 0; k < arr.length-1-i; k++) {
+                //转换
+                Comparable o1 = (Comparable)  arr[k];
+                Comparable o2 = (Comparable)  arr[k+1];
+
+                if ( o1.compareTo(o2) > 0 ){
+                    //交换
+                    Object temp = arr[k];
+                    arr[k] = arr[k+1];
+                    arr[k+1] = temp;
+                }
+            }
+        }
+
+    }
+
+
+    public static void sort(Object[] arr, Comparator c){
+        //冒泡
+        for (int i = 0; i < arr.length-1; i++) {
+            for (int k = 0; k < arr.length-1-i; k++) {
+                // 比较
+                if ( c.compare(arr[k],arr[k+1]) > 0 ){
+                    //交换
+                    Object temp = arr[k];
+                    arr[k] = arr[k+1];
+                    arr[k+1] = temp;
+                }
+            }
+        }
+    }
+}

+ 76 - 0
JavaSE/day08-interface/src/com/lc/day08/interface05/Employee.java

@@ -0,0 +1,76 @@
+package com.lc.day08.interface05;
+
+/**
+ * ClassName: Employee
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/5 15:27
+ * @Version 1.0
+ */
+public class Employee implements Comparable {
+
+//    编号、姓名、薪资、年龄
+
+    private int id;
+    private String name;
+    private double salary;
+    private int age;
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public double getSalary() {
+        return salary;
+    }
+
+    public void setSalary(double salary) {
+        this.salary = salary;
+    }
+
+    public int getAge() {
+        return age;
+    }
+
+    public void setAge(int age) {
+        this.age = age;
+    }
+
+    public Employee(int id, String name, double salary, int age) {
+        this.id = id;
+        this.name = name;
+        this.salary = salary;
+        this.age = age;
+    }
+
+    @Override
+    public String toString() {
+        return "Employee{" +
+                "id=" + id +
+                ", name='" + name + '\'' +
+                ", salary=" + salary +
+                ", age=" + age +
+                '}';
+    }
+
+    @Override
+    public int compareTo(Object o) {
+        //编号
+        Employee e = (Employee)  o;
+
+        return id - e.id;
+    }
+}
+

+ 48 - 0
JavaSE/day08-interface/src/com/lc/day08/interface05/Test01.java

@@ -0,0 +1,48 @@
+package com.lc.day08.interface05;
+
+import java.util.Comparator;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/5 15:34
+ * @Version 1.0
+ */
+public class Test01 {
+    public static void main(String[] args) {
+
+        Employee[] employees = new Employee[5];
+
+        employees[0] = new Employee(1,"a",1299,22);
+        employees[1] = new Employee(3,"b",2299,22);
+        employees[2] = new Employee(2,"e",1399,26);
+        employees[3] = new Employee(5,"f",1599,28);
+        employees[4] = new Employee(4,"d",10299,20);
+
+        //排序
+        ArrayTools.sort(employees);
+
+        for (int i = 0; i < employees.length; i++) {
+            System.out.println(employees[i]);
+        }
+
+
+
+        ArrayTools.sort(employees, new Comparator() {
+            @Override
+            public int compare(Object o1, Object o2) {
+                Employee e1 = (Employee) o1;
+                Employee e2 = (Employee) o2;
+
+                return -(e1.getId() - e2.getId());
+            }
+        });
+
+        System.out.println("---------------");
+
+        for (int i = 0; i < employees.length; i++) {
+            System.out.println(employees[i]);
+        }
+    }
+}

Some files were not shown because too many files changed in this diff