xerga 1 год назад
Родитель
Сommit
e30bf8bb39
100 измененных файлов с 3567 добавлено и 2 удалено
  1. 9 0
      JavaSE/.idea/libraries/java_maven_1_0_SNAPSHOT.xml
  2. 5 0
      JavaSE/.idea/modules.xml
  3. 124 0
      JavaSE/.idea/uiDesigner.xml
  4. 6 0
      JavaSE/.idea/vcs.xml
  5. 0 1
      JavaSE/day04/src/com/lc/day04/exer02/Test02.java
  6. 0 1
      JavaSE/day04/src/com/lc/day04/exer02/Test03.java
  7. 11 0
      JavaSE/day05/day05.iml
  8. 64 0
      JavaSE/day05/src/com/lc/day05/arr/TestArr01.java
  9. 59 0
      JavaSE/day05/src/com/lc/day05/arr/TestArr02.java
  10. 30 0
      JavaSE/day05/src/com/lc/day05/arr1/TestArr01.java
  11. 44 0
      JavaSE/day05/src/com/lc/day05/arr1/TestArr02.java
  12. 62 0
      JavaSE/day05/src/com/lc/day05/arr1/TestArr03.java
  13. 39 0
      JavaSE/day05/src/com/lc/day05/arr1/TestArr04.java
  14. 28 0
      JavaSE/day05/src/com/lc/day05/arr2/Test02.java
  15. 23 0
      JavaSE/day05/src/com/lc/day05/arr2/Test03.java
  16. 22 0
      JavaSE/day05/src/com/lc/day05/arr2/Test04.java
  17. 35 0
      JavaSE/day05/src/com/lc/day05/arr2/Test05.java
  18. 27 0
      JavaSE/day05/src/com/lc/day05/arr2/Test06.java
  19. 26 0
      JavaSE/day05/src/com/lc/day05/arr2/Test07.java
  20. 123 0
      JavaSE/day05/src/com/lc/day05/exer/Exer01.java
  21. 65 0
      JavaSE/day05/src/com/lc/day05/exer/Exer02.java
  22. 44 0
      JavaSE/day05/src/com/lc/day05/exer/Exer03.java
  23. 11 0
      JavaSE/day06/day06.iml
  24. 34 0
      JavaSE/day06/src/com/lc/day06/obj01/Studet.java
  25. 50 0
      JavaSE/day06/src/com/lc/day06/obj01/Test01.java
  26. 24 0
      JavaSE/day06/src/com/lc/day06/obj02/Student.java
  27. 27 0
      JavaSE/day06/src/com/lc/day06/obj02/TestStudent.java
  28. 26 0
      JavaSE/day06/src/com/lc/day06/obj02/TestStudent1.java
  29. 22 0
      JavaSE/day06/src/com/lc/day06/obj03/Husband.java
  30. 55 0
      JavaSE/day06/src/com/lc/day06/obj03/Test01.java
  31. 19 0
      JavaSE/day06/src/com/lc/day06/obj03/Wife.java
  32. 51 0
      JavaSE/day06/src/com/lc/day06/obj04/TestMethod01.java
  33. 39 0
      JavaSE/day06/src/com/lc/day06/obj04/TestMethod02.java
  34. 33 0
      JavaSE/day06/src/com/lc/day06/obj04/TestMethod03.java
  35. 42 0
      JavaSE/day06/src/com/lc/day06/obj04/TestMethod04.java
  36. 73 0
      JavaSE/day06/src/com/lc/day06/obj04/TestMethod05.java
  37. 30 0
      JavaSE/day06/src/com/lc/day06/obj04/TestMethod06.java
  38. 42 0
      JavaSE/day06/src/com/lc/day06/obj05/Person.java
  39. 30 0
      JavaSE/day06/src/com/lc/day06/obj05/Person1.java
  40. 83 0
      JavaSE/day06/src/com/lc/day06/obj05/Test01.java
  41. 26 0
      JavaSE/day06/src/com/lc/day06/obj05/TestPerson.java
  42. 11 0
      JavaSE/day07/day07.iml
  43. 40 0
      JavaSE/day07/src/com/lc/day07/constaract04/AAA.java
  44. 42 0
      JavaSE/day07/src/com/lc/day07/constaract04/Person.java
  45. 22 0
      JavaSE/day07/src/com/lc/day07/constaract04/TestPerson.java
  46. 15 0
      JavaSE/day07/src/com/lc/day07/constaract05/Person.java
  47. 19 0
      JavaSE/day07/src/com/lc/day07/constaract05/TestPerson.java
  48. 51 0
      JavaSE/day07/src/com/lc/day07/constaract06/Dog.java
  49. 30 0
      JavaSE/day07/src/com/lc/day07/constaract06/Person.java
  50. 18 0
      JavaSE/day07/src/com/lc/day07/constaract06/TestDog.java
  51. 27 0
      JavaSE/day07/src/com/lc/day07/exer/Student.java
  52. 92 0
      JavaSE/day07/src/com/lc/day07/exer/TestStudent.java
  53. 31 0
      JavaSE/day07/src/com/lc/day07/exer1/Test01.java
  54. 43 0
      JavaSE/day07/src/com/lc/day07/exer1/Test02.java
  55. 38 0
      JavaSE/day07/src/com/lc/day07/method03/TestMethod.java
  56. 26 0
      JavaSE/day07/src/com/lc/day07/method03/TestMethod1.java
  57. 27 0
      JavaSE/day07/src/com/lc/day07/method03/TestMethod3.java
  58. 56 0
      JavaSE/day07/src/com/lc/day07/overload01/TestMethod01.java
  59. 32 0
      JavaSE/day07/src/com/lc/day07/overload01/TestMethod02.java
  60. 33 0
      JavaSE/day07/src/com/lc/day07/param02/TestMethod01.java
  61. 31 0
      JavaSE/day07/src/com/lc/day07/param02/TestMethod02.java
  62. 12 0
      JavaSE/day08/day08.iml
  63. BIN
      JavaSE/day08/lib/java_maven-1.0-SNAPSHOT.jar
  64. 24 0
      JavaSE/day08/src/com/lc/day08/enc01/A.java
  65. 24 0
      JavaSE/day08/src/com/lc/day08/enc02/B.java
  66. 81 0
      JavaSE/day08/src/com/lc/day08/enc03/Person.java
  67. 42 0
      JavaSE/day08/src/com/lc/day08/enc03/TestPerson.java
  68. 25 0
      JavaSE/day08/src/com/lc/day08/enc04/Person.java
  69. 40 0
      JavaSE/day08/src/com/lc/day08/enc04/TestPerson.java
  70. 28 0
      JavaSE/day08/src/com/lc/day08/enc05/Test.java
  71. 40 0
      JavaSE/day08/src/com/lc/day08/enc05/User.java
  72. 92 0
      JavaSE/day08/src/com/lc/day08/exer01/CreditCard.java
  73. 67 0
      JavaSE/day08/src/com/lc/day08/exer01/DepositCard.java
  74. 54 0
      JavaSE/day08/src/com/lc/day08/exer01/Test01.java
  75. 102 0
      JavaSE/day08/src/com/lc/day08/exer02/CreditCard.java
  76. 75 0
      JavaSE/day08/src/com/lc/day08/exer02/DepositCard.java
  77. 18 0
      JavaSE/day08/src/com/lc/day08/exer02/Test01.java
  78. 44 0
      JavaSE/day08/src/com/lc/day08/inherit01/Animal.java
  79. 17 0
      JavaSE/day08/src/com/lc/day08/inherit01/Cat.java
  80. 23 0
      JavaSE/day08/src/com/lc/day08/inherit01/Dog.java
  81. 36 0
      JavaSE/day08/src/com/lc/day08/inherit01/Test01.java
  82. 64 0
      JavaSE/day08/src/com/lc/day08/inherit02/Test01.java
  83. 26 0
      JavaSE/day08/src/com/lc/day08/methodover01/Phone.java
  84. 36 0
      JavaSE/day08/src/com/lc/day08/methodover01/SmartPhone.java
  85. 20 0
      JavaSE/day08/src/com/lc/day08/methodover01/Test01.java
  86. 11 0
      JavaSE/day08/src/com/lc/day08/methodover02/A.java
  87. 12 0
      JavaSE/day08/src/com/lc/day08/methodover02/B.java
  88. 33 0
      JavaSE/day08/src/com/lc/day08/methodover02/Father.java
  89. 22 0
      JavaSE/day08/src/com/lc/day08/methodover02/Son.java
  90. 20 0
      JavaSE/day08/src/com/lc/day08/protected01/Father.java
  91. 29 0
      JavaSE/day08/src/com/lc/day08/protected02/Son.java
  92. 20 0
      JavaSE/day08/src/com/lc/day08/super02/Person.java
  93. 18 0
      JavaSE/day08/src/com/lc/day08/super02/SmallStudent.java
  94. 33 0
      JavaSE/day08/src/com/lc/day08/super02/Student.java
  95. 23 0
      JavaSE/day08/src/com/lc/day08/super02/Test.java
  96. 15 0
      JavaSE/day08/src/com/lc/day08/super03/Father.java
  97. 24 0
      JavaSE/day08/src/com/lc/day08/super03/Son.java
  98. 22 0
      JavaSE/day08/src/com/lc/day08/this01/Person.java
  99. 22 0
      JavaSE/day08/src/com/lc/day08/this01/Student.java
  100. 26 0
      JavaSE/day08/src/com/lc/day08/this01/Test.java

+ 9 - 0
JavaSE/.idea/libraries/java_maven_1_0_SNAPSHOT.xml

@@ -0,0 +1,9 @@
+<component name="libraryTable">
+  <library name="java_maven-1.0-SNAPSHOT">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/day08/lib/java_maven-1.0-SNAPSHOT.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES />
+  </library>
+</component>

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

@@ -7,6 +7,11 @@
       <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$/day07/day07.iml" filepath="$PROJECT_DIR$/day07/day07.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day08/day08.iml" filepath="$PROJECT_DIR$/day08/day08.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day09/day09.iml" filepath="$PROJECT_DIR$/day09/day09.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>

+ 6 - 0
JavaSE/.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
+  </component>
+</project>

+ 0 - 1
JavaSE/day04/src/com/lc/day04/exer02/Test02.java

@@ -31,7 +31,6 @@ public class Test02 {
         }
 
 
-
         int[] inputBlueArr = new int[5];
         //输入
         Scanner sc = new Scanner(System.in);

+ 0 - 1
JavaSE/day04/src/com/lc/day04/exer02/Test03.java

@@ -11,7 +11,6 @@ import java.util.Scanner;
  */
 public class Test03 {
 
-
         public static void main(String[] args) {int money;boolean play=true;
             Scanner scanner=new Scanner(System.in);int getin;int bei;int _final;int ori;
 

+ 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>

+ 64 - 0
JavaSE/day05/src/com/lc/day05/arr/TestArr01.java

@@ -0,0 +1,64 @@
+package com.lc.day05.arr;
+
+/**
+ * ClassName: TestArr01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/18 9:58
+ * @Version 1.0
+ */
+public class TestArr01 {
+
+    public static void main(String[] args) {
+
+        //声明
+        int[][] arr1; // 推荐
+
+        //特别
+        int  arr2[][];
+
+        int[] arr3[];
+
+
+        //赋值
+        int[][] arr4 = new int[][]{
+                {1,2,3}, // 索引  0  小数组  0 1  2
+                {4,5,6,5,7},
+                {7,8,9}
+        };
+
+
+        //获取 第一个数组的第二个元素
+        System.out.println(arr4[0][1]); // 获取
+
+        //赋值
+        arr4[0][1] = 20;
+        System.out.println(arr4[0][1]);
+
+        //大数组的小数组 存储的是地址
+        System.out.println(arr4);
+
+        //小数组
+        System.out.println(arr4[0]);
+        System.out.println(arr4[1]);
+        System.out.println(arr4[2]);
+
+
+        //第二个数组的最后一个
+        int length = arr4[1].length;
+
+        System.out.println(arr4[1][length-1]); // 7
+
+
+        //遍历
+        for (int i = 0; i < arr4.length; i++) {
+            //System.out.println(arr4[i]);
+            //每一列
+            for (int k = 0; k < arr4[i].length; k++) {
+                System.out.print(arr4[i][k]+","); // 遍历
+            }
+            System.out.println();
+        }
+        
+    }
+}

+ 59 - 0
JavaSE/day05/src/com/lc/day05/arr/TestArr02.java

@@ -0,0 +1,59 @@
+package com.lc.day05.arr;
+
+/**
+ * ClassName: TestArr01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/18 9:58
+ * @Version 1.0
+ */
+public class TestArr02 {
+
+    public static void main(String[] args) {
+
+        //二维
+        //{ {1,2} {1,2,3} }
+        // 固定大数组的长度
+        int[][] arr1 = new int[3][];
+        // 长度3  小数组的元素个数 任意。
+
+        // 大数组长度和 小数组长度
+        int[][] arr2 = new int[3][3];
+
+        //小数组存储 3个元素
+
+        int[][] arr3 = new int[3][3];
+
+        arr3[1][2] = 44;
+
+        arr3[0][0] = 12;
+
+
+        for (int i = 0; i < arr3.length; i++) {
+            for (int k = 0; k < arr3[i].length; k++) {
+                System.out.print(" "+ arr3[i][k]);
+            }
+            System.out.println();
+        }
+        
+
+
+
+        int[][] arr4 = new int[3][];
+
+
+        //arr4[0][0] = 100; // ?  空指针
+
+        // 给大数组赋值。 小数组
+        // 创建小数组 赋值
+        int[] a = {1,2,3,4,5};
+        //静态赋值
+        arr4[0] = a;
+        //动态赋值
+        int[] b = new int[10];
+        arr4[1] = b;
+
+
+        
+    }
+}

+ 30 - 0
JavaSE/day05/src/com/lc/day05/arr1/TestArr01.java

@@ -0,0 +1,30 @@
+package com.lc.day05.arr1;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: TestArr01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/18 14:14
+ * @Version 1.0
+ */
+public class TestArr01 {
+
+    //数组的反转
+    public static void main(String[] args) {
+        int[] arr = {1,2,3,4,5,6,7};
+
+        for (int i = 0; i < arr.length / 2; i++) {
+            //交换
+            int temp = arr[i];
+            arr[i] = arr[arr.length-i-1];
+            arr[arr.length-i-1] = temp;
+        }
+
+        //输出
+        System.out.println(Arrays.toString(arr));
+    }
+
+
+}

+ 44 - 0
JavaSE/day05/src/com/lc/day05/arr1/TestArr02.java

@@ -0,0 +1,44 @@
+package com.lc.day05.arr1;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: TestArr01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/18 14:14
+ * @Version 1.0
+ */
+public class TestArr02 {
+
+    //数组的复制
+    public static void main(String[] args) {
+        int[] arr = {1,2,3,4,5,6,7};
+
+        //int[] arr1 = arr; //引用地址
+
+        //复制
+        //长度
+        int[] newArr = new int[arr.length];
+
+        //元素
+        for (int i = 0; i < arr.length; i++) {
+            newArr[i] = arr[i];
+        }
+
+        //输出
+        System.out.println("旧"+Arrays.toString(arr));
+        System.out.println("新"+Arrays.toString(newArr));
+
+        //修改 新
+        newArr[0] = 10;
+
+        System.out.println("旧"+Arrays.toString(arr));
+        System.out.println("新"+Arrays.toString(newArr));
+
+        System.out.println(arr);
+        System.out.println(newArr);
+    }
+
+
+}

+ 62 - 0
JavaSE/day05/src/com/lc/day05/arr1/TestArr03.java

@@ -0,0 +1,62 @@
+package com.lc.day05.arr1;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: TestArr01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/18 14:14
+ * @Version 1.0
+ */
+public class TestArr03 {
+
+    //二分查找
+    public static void main(String[] args) {
+        int[] arr = {1,2,3,4,5,6,7,9,10,11,13,17,20,22,28};
+
+        int val = 20;
+        int count = 0;
+
+        //索引
+        int letf = 0;
+        int right = arr.length-1;
+
+        int mid = (letf+right)/2;
+
+        boolean flag = false;
+
+        while (right >= letf){
+            //对比
+            if (arr[mid] > val){
+                right =  mid - 1;
+            }
+            if (arr[mid] < val){
+                letf =  mid + 1;
+            }
+            if (arr[mid] == val){
+                //改变
+                flag = true;
+
+
+                break;
+            }
+            //重新计算
+            mid = (letf+right)/2;
+
+            //计数
+            count++;
+        }
+
+
+        if (!flag){
+            System.out.println("没有查到:"+val);
+        }else{
+            System.out.println("查到,索引是:"+mid);
+        }
+
+
+    }
+
+
+}

+ 39 - 0
JavaSE/day05/src/com/lc/day05/arr1/TestArr04.java

@@ -0,0 +1,39 @@
+package com.lc.day05.arr1;
+
+import java.sql.SQLOutput;
+import java.util.Arrays;
+
+/**
+ * ClassName: TestArr01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/18 14:14
+ * @Version 1.0
+ */
+public class TestArr04 {
+
+    //冒泡排序
+    public static void main(String[] args) {
+        int[] arr = {11,14,22,5,8,9};
+
+        //外层
+        int count = 0;
+        for (int i = 0; i < arr.length-1; i++) {
+            for (int k = 0; k < arr.length - i - 1 ; k++) {
+                if ( arr[k] > arr[k+1] ){
+                    //交换
+                    int temp = arr[k];
+                    arr[k] = arr[k+1];
+                    arr[k+1] = temp;
+                }
+            }
+            //计数
+            count++;
+        }
+
+        System.out.println(Arrays.toString(arr));
+        System.out.println(count);
+    }
+
+
+}

+ 28 - 0
JavaSE/day05/src/com/lc/day05/arr2/Test02.java

@@ -0,0 +1,28 @@
+package com.lc.day05.arr2;
+
+import java.lang.reflect.Array;
+import java.util.Arrays;
+
+/**
+ * ClassName: Test02
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/18 16:07
+ * @Version 1.0
+ */
+public class Test02 {
+
+    public static void main(String[] args) {
+
+        int[] arr = {1,2,3};
+
+        //数组拼接
+        String string = Arrays.toString(arr);
+
+        int[] arr1 = null;
+        String string1 = Arrays.toString(arr1);
+
+        System.out.println(string);
+        System.out.println(string1);
+    }
+}

+ 23 - 0
JavaSE/day05/src/com/lc/day05/arr2/Test03.java

@@ -0,0 +1,23 @@
+package com.lc.day05.arr2;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: Test02
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/18 16:07
+ * @Version 1.0
+ */
+public class Test03 {
+
+    public static void main(String[] args) {
+        //排序
+        int[] arr = {10,21,3,2,23,10,101};
+
+        Arrays.sort(arr);
+
+        System.out.println(Arrays.toString(arr));
+
+    }
+}

+ 22 - 0
JavaSE/day05/src/com/lc/day05/arr2/Test04.java

@@ -0,0 +1,22 @@
+package com.lc.day05.arr2;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: Test02
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/18 16:07
+ * @Version 1.0
+ */
+public class Test04 {
+
+    public static void main(String[] args) {
+        //二分查找
+        int[] arr = {1,2,3,4,5,6,7,9,10,11,13,17,20,22,28};
+
+        int i = Arrays.binarySearch(arr, 13);
+        System.out.println(i);
+
+    }
+}

+ 35 - 0
JavaSE/day05/src/com/lc/day05/arr2/Test05.java

@@ -0,0 +1,35 @@
+package com.lc.day05.arr2;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: Test02
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/18 16:07
+ * @Version 1.0
+ */
+public class Test05 {
+
+    public static void main(String[] args) {
+        //数组复制
+        int[] arr = {1,2,3,4,5,6,7,9,10,11,13,17,20,22,28};
+
+        //根据原数组的长度进行复制
+        int[] ints = Arrays.copyOf(arr, arr.length);
+        int[] ints1 = Arrays.copyOf(arr, 3);
+
+        System.out.println(Arrays.toString(ints));
+        System.out.println(Arrays.toString(ints1));
+
+        int[] a1 = {1,2,3,4,5,6,7,9,10,11,13,17,20,22,28};
+
+        int[] a2 = new int[3];
+
+        //System.arraycopy(a1,2,a2,0,3);
+        System.arraycopy(a1,3,a2,1,2);
+
+        System.out.println(Arrays.toString(a2));
+
+    }
+}

+ 27 - 0
JavaSE/day05/src/com/lc/day05/arr2/Test06.java

@@ -0,0 +1,27 @@
+package com.lc.day05.arr2;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: TestArr01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/18 14:14
+ * @Version 1.0
+ */
+public class Test06 {
+
+    //比较数组
+    public static void main(String[] args) {
+        int[] arr1 = {11,14,22,5,8,9};
+        int[] arr2 = {11,14,22,5,8,9};
+
+        //比较数组
+        boolean equals = Arrays.equals(arr1, arr2);
+
+        System.out.println(equals);
+
+    }
+
+
+}

+ 26 - 0
JavaSE/day05/src/com/lc/day05/arr2/Test07.java

@@ -0,0 +1,26 @@
+package com.lc.day05.arr2;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: TestArr01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/18 14:14
+ * @Version 1.0
+ */
+public class Test07 {
+
+    //比较数组
+    public static void main(String[] args) {
+        int[] arr1 = new int[10];
+
+        Arrays.fill(arr1,1);
+
+        System.out.println(Arrays.toString(arr1));
+
+
+    }
+
+
+}

+ 123 - 0
JavaSE/day05/src/com/lc/day05/exer/Exer01.java

@@ -0,0 +1,123 @@
+package com.lc.day05.exer;
+
+import java.util.Arrays;
+import java.util.Scanner;
+
+/**
+ * ClassName: Exer01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/18 9:18
+ * @Version 1.0
+ */
+public class Exer01 {
+
+    /*
+    双色球(蓝球“355”+红球“71”),即蓝球在1-35之间的号码中随机选取5个,
+    红球在1-7之间的号码中随机选取1个,组成一期的中奖号码,和用户输入的 进行比较进行开奖。
+    开发提示:
+
+    - 声明一个int类型的 蓝球 数组before,长度为55个不同的数字(不重复);
+    - 声明一个int类型的 红球变量 after,1-7之间的随机数;
+    - 猜数字 输入 5个蓝球  1 个红球
+    - 比较
+      - 5个蓝球 数组中对比  中 5个   + 红球   中 1 个   一等奖  300w
+      - 5个蓝球 数组中对比  中 4个   + 红球   中 1 个   二等奖  100w
+      - 5个蓝球 数组中对比  中 4个   + 红球   中 0 个   三等奖  1000
+      - 5个蓝球 数组中对比  中 3个   + 红球   中 1 个   四等奖  1000
+      - 5个蓝球 数组中对比  中 3个   + 红球   中 0 个   五等奖  1000
+     */
+    public static void main(String[] args) {
+        //用户输入
+        Scanner scanner = new Scanner(System.in);
+
+        //蓝球
+        int[] blueArr = new int[5];
+
+        //不重复的 1-35的5个数字  存入数组
+        for (int i = 0; i < blueArr.length; i++) {
+            //随机数
+            int random =(int)(Math.random() * 10)+1;
+            //赋值
+            blueArr[i] = random;
+            //比较
+            for (int k = 0; k < i; k++) {
+                if (blueArr[k] == random){
+                    i --;
+                    break;
+                }
+            }
+        }
+        //输出
+        //System.out.println(Arrays.toString(blueArr));
+
+        //红球
+        int redBall =(int)(Math.random() * 7)+1;
+
+        System.out.println("蓝球:"+Arrays.toString(blueArr));
+        System.out.println("红球:"+redBall);
+
+        //输入 蓝球数组
+        int[] inputBlueBall = new int[5];
+
+        for (int i = 0; i < inputBlueBall.length; i++) {
+            System.out.println("请输入第"+(i+1)+"蓝球");
+            int inputNumber = scanner.nextInt();
+            //赋值
+            inputBlueBall[i] = inputNumber;
+            //比较
+            for (int k = 0; k < i; k++) {
+                if (inputBlueBall[k] == inputNumber){
+                    System.out.println("输入的"+inputNumber+"已经存在请重新输入。");
+                    i --;
+                    break;
+                }
+            }
+        }
+
+        //System.out.println(Arrays.toString(inputBlueBall));
+        System.out.println("请入红球");
+        int inputRedNumber = scanner.nextInt();
+
+        // 比较  蓝球个数
+        int count = 0;
+
+        for (int i = 0; i < blueArr.length; i++) {
+            for (int k = 0; k < inputBlueBall.length; k++) {
+                if (blueArr[i] == inputBlueBall[k]){
+                    count++;
+                    break;
+                }
+            }
+        }
+
+        //根据 个数判断
+
+        if ( count == 5 && redBall == inputRedNumber  ){
+            System.out.println("一等奖 500w");
+        }  else if ( count == 5  ){
+            System.out.println("二等奖");
+        }  else if ( count == 3 && inputRedNumber == redBall ){
+            System.out.println("三等奖");
+        }  else if ( count == 3  ){
+            System.out.println("四等奖");
+        }  else if ( count == 2 && inputRedNumber == redBall ){
+            System.out.println("五等奖");
+        }  else if ( count == 2 || inputRedNumber == redBall ){
+            System.out.println("六等奖");
+        }  else {
+            System.out.println("遗憾");
+        }
+
+        System.out.println(Arrays.toString(blueArr));
+        System.out.println(Arrays.toString(inputBlueBall));
+
+        System.out.println("红:"+redBall+"-输入红球:"+inputRedNumber);
+
+        System.out.println(count);
+
+
+
+    }
+
+}

+ 65 - 0
JavaSE/day05/src/com/lc/day05/exer/Exer02.java

@@ -0,0 +1,65 @@
+package com.lc.day05.exer;
+
+/**
+ * ClassName: Exer02
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/18 10:41
+ * @Version 1.0
+ */
+public class Exer02 {
+
+    /*
+    第一季度    89000  110000  80000
+    第二季度    78000  140000  280000
+    第三季度    14500  189000  220000
+     */
+    public static void main(String[] args) {
+
+        double[][] arr = {
+                {89000, 110000, 80000},
+                {78000,  140000,  280000},
+                {14500, 189000,  220000}
+        };
+
+        /*
+        录入人员  录入错误.
+        第二季度  第二个月  需要修改为 150000
+        计算 第三季度  整体销售额 和 平均值
+        计算年销售额和平均值。
+         */
+        System.out.println(arr[1][1]);
+        arr[1][1] = 150000;
+        System.out.println(arr[1][1]);
+
+        //维护
+        // double v = arr[2][0] + arr[2][1] + arr[2][2];
+
+        double thrSum = 0;
+
+        for (int i = 0; i < arr[2].length; i++) {
+            thrSum+= arr[2][i];
+        }
+
+        //平均
+        double avg =  thrSum / arr[2].length;
+        System.out.println("平均值:"+avg +" 和:"+thrSum);
+
+
+        double sum = 0;
+
+        int count = 0;
+
+        //年销售额
+        for (int i = 0; i < arr.length; i++) {
+            for (int k = 0; k < arr[i].length; k++) {
+                sum+=arr[i][k];
+
+                count++;
+            }
+        }
+
+        System.out.println("和"+sum + "平均值:"+sum/count);
+    }
+
+}

+ 44 - 0
JavaSE/day05/src/com/lc/day05/exer/Exer03.java

@@ -0,0 +1,44 @@
+package com.lc.day05.exer;
+
+/**
+ * ClassName: Exer02
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/18 10:41
+ * @Version 1.0
+ */
+public class Exer03 {
+
+
+    public static void main(String[] args) {
+
+        int[][] arr = new int[10][];
+
+        for (int i = 0; i < arr.length; i++) {
+            //小数组
+            int[] ints = new int[i + 1];
+            //赋值
+            arr[i] = ints;
+
+            arr[i][0] = arr[i][i] = 1;
+
+            for (int j = 1; j < i; j++) {
+
+                arr[i][j] = arr[i-1][j-1] + arr[i-1][j];
+
+            }
+        }
+
+
+        //输出
+        for (int i = 0; i < arr.length; i++) {
+            for (int k = 0; k <= i; k++) {
+                System.out.print(" "+arr[i][k]);
+            }
+            System.out.println();
+        }
+
+
+    }
+
+}

+ 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>

+ 34 - 0
JavaSE/day06/src/com/lc/day06/obj01/Studet.java

@@ -0,0 +1,34 @@
+package com.lc.day06.obj01;
+
+/**
+ * ClassName: Studet
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/25 9:44
+ * @Version 1.0
+ */
+public class Studet {
+
+    //属性 = 成员变量
+    String name;
+
+    int age;
+
+    double height;
+
+
+    //行为  方法
+    /*
+    【publicvoid 方法名称(){
+        方法体
+    }
+     */
+    void study(){
+        System.out.println("study");
+    }
+
+    void eat(){
+        System.out.println("eat");
+    }
+
+}

+ 50 - 0
JavaSE/day06/src/com/lc/day06/obj01/Test01.java

@@ -0,0 +1,50 @@
+package com.lc.day06.obj01;
+
+import javax.naming.Name;
+import java.util.Scanner;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/25 9:23
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) {
+        //使用
+        //数据类型 变量 = new 创建对象(); // 类名() 记住类名()
+        // 相同包下 不需要导入
+        Studet student =  new Studet();
+        // 使用 属性  . 方式
+        student.name = "凡凡"; //设置
+        String name = student.name;
+
+        //名称
+        System.out.println(name); //获取
+
+        //使用方法 . 方法名称()
+        //不调用 不执行
+        student.study();
+        student.eat();
+
+
+
+
+
+    }
+
+    public static void main1(String[] args) {
+
+        //import 找到对应的类
+        //       根据类 创建对象。
+        Scanner scanner = new Scanner(System.in);
+
+        //String
+        String s = "123";
+
+    }
+
+
+}

+ 24 - 0
JavaSE/day06/src/com/lc/day06/obj02/Student.java

@@ -0,0 +1,24 @@
+package com.lc.day06.obj02;
+
+/**
+ * ClassName: Student
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/25 10:14
+ * @Version 1.0
+ */
+public class Student {
+    //成员变量
+    public String name;
+    public int age;
+
+    //成员方法 使用成员变量
+    public void study() {
+        System.out.println( name + "好好学习,天天向上");
+    }
+
+    public void doHomework() {
+        System.out.println( name + "键盘敲烂,月薪过万");
+    }
+
+}

+ 27 - 0
JavaSE/day06/src/com/lc/day06/obj02/TestStudent.java

@@ -0,0 +1,27 @@
+package com.lc.day06.obj02;
+
+/**
+ * ClassName: TestStudent
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/25 10:14
+ * @Version 1.0
+ */
+public class TestStudent {
+    public static void main(String[] args) {
+        //创建对象
+        Student s = new Student();
+
+        System.out.println(s);
+        //使用对象
+        System.out.println(s.name + "," + s.age);
+
+        s.name = "凡凡";
+        s.age = 30;
+
+        System.out.println(s.name + "," + s.age);
+
+        s.study();
+        s.doHomework();
+    }
+}

+ 26 - 0
JavaSE/day06/src/com/lc/day06/obj02/TestStudent1.java

@@ -0,0 +1,26 @@
+package com.lc.day06.obj02;
+
+/**
+ * ClassName: TestStudent
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/25 10:14
+ * @Version 1.0
+ */
+public class TestStudent1 {
+    public static void main(String[] args) {
+        //创建对象
+        Student s1 = new Student();
+        s1.name = "凡凡";
+        s1.age = 30;
+
+        Student s2 = new Student();
+        //s1 = s2;
+        s2 = s1;
+//        System.out.println(s1.name); //   null
+//        System.out.println(s1.age);  //     0
+
+        System.out.println(s2.name); //  凡凡
+        System.out.println(s2.age);  //  30
+    }
+}

+ 22 - 0
JavaSE/day06/src/com/lc/day06/obj03/Husband.java

@@ -0,0 +1,22 @@
+package com.lc.day06.obj03;
+
+/**
+ * ClassName: Husband
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/25 11:00
+ * @Version 1.0
+ */
+public class Husband {
+
+    String name;
+
+    int age;
+
+    String desc;
+
+    //妻子
+    Wife wife;
+
+
+}

+ 55 - 0
JavaSE/day06/src/com/lc/day06/obj03/Test01.java

@@ -0,0 +1,55 @@
+package com.lc.day06.obj03;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/25 11:00
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) {
+        //丈夫对象
+        Husband h = new Husband();
+
+        h.name = "张三";
+        h.age = 22;
+        h.desc = "高达帅气";
+
+        //类属性 默认 null
+        //创建  妻子对象
+        Wife wife = new Wife();
+        wife.name = "小红";
+        wife.age = 25;
+        wife.desc = "温柔大方";
+
+        wife.husband = h;
+
+        //在丈夫属性中给妻子 赋值
+        h.wife = wife;
+
+        System.out.println("丈夫信息:"+h.name+" "+h.age+" "+h.desc);
+        System.out.println("妻子信息:"+h.wife.name+""+h.wife.age+" "+h.wife.desc);
+        //h.null.name // NullPointerException
+
+
+        //通过妻子访问丈夫
+        System.out.println(wife.husband.name);
+
+
+    }
+
+
+}
+
+class A {
+
+    String n; //位置不同 堆  对象创建 产生  对象 所有的引用 都为null 销毁
+
+    public static void main(String[] args) {
+        String a ; //栈  入栈 创建出栈消失
+        //System.out.println(n);
+    }
+
+}

+ 19 - 0
JavaSE/day06/src/com/lc/day06/obj03/Wife.java

@@ -0,0 +1,19 @@
+package com.lc.day06.obj03;
+
+/**
+ * ClassName: Wife
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/25 11:01
+ * @Version 1.0
+ */
+public class Wife {
+
+    String name;
+
+    int age;
+
+    String desc;
+
+    Husband husband;
+}

+ 51 - 0
JavaSE/day06/src/com/lc/day06/obj04/TestMethod01.java

@@ -0,0 +1,51 @@
+package com.lc.day06.obj04;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: TestMethod01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/25 11:56
+ * @Version 1.0
+ */
+public class TestMethod01 {
+
+    public static void main(String[] args) {
+        //int[] arr;
+
+        //对象
+        TestMethod01 testMethod01 = new TestMethod01();
+        //实参
+        int[] a = {1,3,6,11,23,6,32,87};
+
+        //调用
+        testMethod01.sortArr(a);
+
+        //查看是否排序
+        System.out.println(Arrays.toString(a));
+
+    }
+
+
+    //对数组 进行排序
+
+    /**
+     *
+     * @param 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;
+                }
+            }
+        }
+    }
+
+}

+ 39 - 0
JavaSE/day06/src/com/lc/day06/obj04/TestMethod02.java

@@ -0,0 +1,39 @@
+package com.lc.day06.obj04;
+
+import com.lc.day06.obj02.Student;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: TestMethod01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/25 11:56
+ * @Version 1.0
+ */
+public class TestMethod02 {
+
+    public static void main(String[] args) {
+
+        TestMethod02 testMethod02 = new TestMethod02();
+        Student student = new Student();
+        student.name = "峰峰";
+        student.age = 28;
+
+        //传入实参
+        testMethod02.printStudentInfo(student);
+
+    }
+
+    //打印学生信息
+
+    /**
+     * student
+     */
+    public void printStudentInfo( Student student ){
+        //打印
+        System.out.println("姓名:"+student.name);
+        System.out.println("年龄: "+student.age);
+    }
+
+}

+ 33 - 0
JavaSE/day06/src/com/lc/day06/obj04/TestMethod03.java

@@ -0,0 +1,33 @@
+package com.lc.day06.obj04;
+
+import com.lc.day06.obj02.Student;
+
+/**
+ * ClassName: TestMethod01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/25 11:56
+ * @Version 1.0
+ */
+public class TestMethod03 {
+
+    public static void main(String[] args) {
+        TestMethod03 testMethod03 = new TestMethod03();
+
+        //接收返回值
+        int random = testMethod03.random();
+
+        //使用 random
+        System.out.println(random);
+
+    }
+
+    //返回 1- 10之间的随机数。
+    public int random(){
+        //maht.rondom(); //静态方法;
+        double random = Math.random();
+        //返回int
+        int i = (int) (random * 10) + 1;
+        return i;
+    }
+}

+ 42 - 0
JavaSE/day06/src/com/lc/day06/obj04/TestMethod04.java

@@ -0,0 +1,42 @@
+package com.lc.day06.obj04;
+
+
+
+/**
+ * ClassName: TestMethod01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/25 11:56
+ * @Version 1.0
+ */
+public class TestMethod04 {
+
+    public static void main(String[] args) {
+        TestMethod04 testMethod04 = new TestMethod04();
+
+        //调用  需要返回值接收
+        char i = testMethod04.randomChar();
+
+        System.out.println(i);
+
+    }
+
+    /**
+     *
+     * @return 返回 随机字符
+     */
+    public char randomChar(){
+        //数组 添加字符
+//        char[] arr = new char[26];
+//        for (int i = 0; i < arr.length; i++) {
+//            arr[i] = (char) ('A'+i);
+//        }
+//        //随机值
+//        int v =(int)( Math.random() * arr.length);
+         //65 - 90 随机数
+//        return arr[v];
+
+//        char c = (char) ((Math.random() * (90 - 65)) + 65);
+        return (char) ((Math.random() * (90 - 65)) + 65);
+    }
+}

+ 73 - 0
JavaSE/day06/src/com/lc/day06/obj04/TestMethod05.java

@@ -0,0 +1,73 @@
+package com.lc.day06.obj04;
+
+
+
+/**
+ * ClassName: TestMethod01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/25 11:56
+ * @Version 1.0
+ */
+public class TestMethod05 {
+
+    public static void main(String[] args) {
+        TestMethod05 testMethod05 = new TestMethod05();
+
+        int[] arr = {102,2,3,43,12,41,67,101};
+        //传参数
+        //调用  需要返回值接收
+        int max2Arr = testMethod05.getMax2Arr(arr);
+
+        System.out.println("最大值"+max2Arr);
+
+        //a- b随机数
+        int a = testMethod05.getMax(5,10);
+        System.out.println(a);
+        // 直接使用
+        System.out.println(testMethod05.getMax(5,10));
+
+
+        // 在数中查找
+        int index2Arr = testMethod05.getIndex2Arr(arr, 103);
+        System.out.println("索引:"+index2Arr);
+    }
+
+    //找出数组中最大值返回。
+    public int getMax2Arr( int[] arr){
+        //求最大值
+        int max = arr[0];
+        
+        //循环比较
+        for (int i = 1; i < arr.length; i++) {
+            if (arr[i] > max ){
+                max = arr[i];
+            }
+        }
+        return max;
+    }
+
+    //根数传入的 最大值和最小值   生成随机数 范围在 传入的最大值和最小值之间。 并返回。
+    //参数
+    //返回值
+    public int getMax( int a , int b ){
+        return (int)((Math.random() * (b - a) ) + a);
+    }
+
+    //根据传入的数值 找出数组中的下标位置。 没有返回 -1
+    //查找数组的元素 返回 索引
+    public  int getIndex2Arr( int[] arr , int val){
+        //索引
+        int index = -1;
+        //顺序比较
+        for (int i = 0; i < arr.length; i++) {
+            if (arr[i] == val){
+                index = i;
+                //break;
+            }
+        }
+        return index;
+    }
+
+
+}

+ 30 - 0
JavaSE/day06/src/com/lc/day06/obj04/TestMethod06.java

@@ -0,0 +1,30 @@
+package com.lc.day06.obj04;
+
+
+
+/**
+ * ClassName: TestMethod01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/25 11:56
+ * @Version 1.0
+ */
+public class TestMethod06 {
+
+    public static void main(String[] args) {
+
+    }
+
+
+    public int getMax2Arr( int[] arr){
+
+        return 1;
+    }
+
+
+    public void test(){
+        return; //不能有值  代表结束方法。
+    }
+
+
+}

+ 42 - 0
JavaSE/day06/src/com/lc/day06/obj05/Person.java

@@ -0,0 +1,42 @@
+package com.lc.day06.obj05;
+
+/**
+ * ClassName: Person
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/25 15:56
+ * @Version 1.0
+ */
+public class Person {
+//
+//    name:int
+//    age:int
+    public String name;
+    public int age;
+
+    //方法
+    public void study(){
+        System.out.println("studying");
+    }
+
+    public String getName(){
+        return name;
+    }
+
+    public void setName( String  n ){
+        name = n;
+    }
+
+    public int getAge(){
+        return age;
+    }
+
+    public void  setAge( int a  ){
+        age = a;
+    }
+
+    //getinfo
+    public String getInfo(){
+        return "name:"+name + "age:"+age;
+    }
+}

+ 30 - 0
JavaSE/day06/src/com/lc/day06/obj05/Person1.java

@@ -0,0 +1,30 @@
+package com.lc.day06.obj05;
+
+/**
+ * ClassName: Person
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/25 15:49
+ * @Version 1.0
+ */
+public class Person1 {
+
+
+    public static void main(String[] args) {
+        Person1 p1 = new Person1();
+        p1.eat();
+
+    }
+    public static void eat() {
+        sleep();
+        System.out.println("人:吃饭");
+    }
+    public static void sleep(){
+        sport();
+        System.out.println("人:睡觉");
+
+    }
+    public static void sport(){
+        System.out.println("人:运动");
+    }
+}

+ 83 - 0
JavaSE/day06/src/com/lc/day06/obj05/Test01.java

@@ -0,0 +1,83 @@
+package com.lc.day06.obj05;
+
+/**
+* ClassName: Test01
+*
+* @Author 爱扣钉-陈晨
+* @Create 2023/11/25 16:45
+* @Version 1.0
+*/
+public class Test01 {
+    public static void main(String[] args) {
+        int m = 0,n= 0;
+
+        int k= 0;
+
+        int flag  = 0;//右 0 下 1 左 2 上 3
+
+        //规定数组
+        int[][]a=new int[4][4];
+        //数组元素赋值
+        while (k<15){
+            switch (flag) {
+                case 0:
+                    if (n < 3 && a[m][n + 1] == 0) {
+                        k++;
+                        a[m][n] = k;
+                        n++;
+                        break;
+                    } else {
+                        flag = (flag + 1) % 4;
+                    }
+
+                case 1:
+                    if (m < 3 && a[m + 1][n] == 0) {
+                        k++;
+                        a[m][n] = k;
+                        m++;
+                        break;
+                    } else {
+                        flag = (flag + 1) % 4;
+                    }
+
+                case 2:
+                    if (n > 0 && a[m][n - 1] == 0) {
+                        k++;
+                        a[m][n] = k;
+                        n--;
+                        break;
+                    } else {
+                        flag = (flag + 1) % 4;
+                    }
+
+                case 3:
+                    if (m > 0 && a[m - 1][n] == 0) {
+                        k++;
+                        a[m][n] = k;
+                        m--;
+                        break;
+                    } else {
+                        flag = (flag + 1) % 4;
+                    }
+
+            }
+
+            //打印数组
+        }
+        if ( m == a.length/2 && n == a.length/2 -1  ){
+            a[m][n] = 16;
+        }
+
+        for (int i = 0; i <4; i++) {
+            for (int j = 0; j <4 ; j++) {
+                System.out.print(a[i][j]+" ");
+            }
+            System.out.println();
+        }
+
+
+
+    }
+
+
+}

+ 26 - 0
JavaSE/day06/src/com/lc/day06/obj05/TestPerson.java

@@ -0,0 +1,26 @@
+package com.lc.day06.obj05;
+
+/**
+ * ClassName: TestPerson
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/25 16:00
+ * @Version 1.0
+ */
+public class TestPerson {
+
+
+    public static void main(String[] args) {
+        Person person = new Person();
+
+        person.setName("凡凡");
+        person.setAge(40);
+
+        System.out.println(person.getName());
+        System.out.println(person.getAge());
+
+        //打印信息
+        String info = person.getInfo();
+        System.out.println(info);
+    }
+}

+ 11 - 0
JavaSE/day07/day07.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>

+ 40 - 0
JavaSE/day07/src/com/lc/day07/constaract04/AAA.java

@@ -0,0 +1,40 @@
+package com.lc.day07.constaract04;
+
+/**
+ * ClassName: AAA
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 16:00
+ * @Version 1.0
+ */
+public class AAA {
+
+    /*
+    如果没有定义构造方法,系统将给出一个默认的无参数构造方法
+    public class AAA {
+        public AAA() {
+        }
+    }
+     */
+
+    //如果定义了构造方法,系统将不再提供默认的构造方法
+    public AAA( String n ){
+
+    }
+    public AAA( String n , int a ){
+
+    }
+    public AAA( String n , int a , int c ){
+
+    }
+    public AAA(  ){
+
+    }
+
+
+    public static void main(String[] args) {
+        //如果自定义了带参构造方法,还要使用无参数构造方法,就必须再写一个无参数构造方法
+        AAA aaa = new AAA();
+    }
+
+}

+ 42 - 0
JavaSE/day07/src/com/lc/day07/constaract04/Person.java

@@ -0,0 +1,42 @@
+package com.lc.day07.constaract04;
+
+/**
+ * ClassName: Person
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 15:53
+ * @Version 1.0
+ */
+public class Person {
+
+    public String name;
+    public int age;
+
+    /*
+    无参数
+     */
+    public Person(){
+        name = "zs";
+        age = 1;
+    }
+
+    /*
+    有参数 : 参数给属性赋值
+     */
+    public Person( String n , int a ){
+        if (a > 150 || a < 0 ){
+            System.out.println("年龄不符合");
+        }else{
+            age = a;
+        }
+        name = n;
+
+    }
+
+
+    public String getInfo(){
+        return "name:"+name+"  age:"+age;
+    }
+
+
+}

+ 22 - 0
JavaSE/day07/src/com/lc/day07/constaract04/TestPerson.java

@@ -0,0 +1,22 @@
+package com.lc.day07.constaract04;
+
+/**
+ * ClassName: TestPerson
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 15:56
+ * @Version 1.0
+ */
+public class TestPerson {
+    public static void main(String[] args) {
+        //无参数
+        Person person = new Person();
+        System.out.println(person.getInfo());
+
+        //有参数
+        Person person1 = new Person("坤坤", -22);
+
+        System.out.println(person1.getInfo());
+
+    }
+}

+ 15 - 0
JavaSE/day07/src/com/lc/day07/constaract05/Person.java

@@ -0,0 +1,15 @@
+package com.lc.day07.constaract05;
+
+/**
+ * ClassName: Person
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 16:34
+ * @Version 1.0
+ */
+public class Person {
+
+    public Person() {
+        System.out.println(this);
+    }
+}

+ 19 - 0
JavaSE/day07/src/com/lc/day07/constaract05/TestPerson.java

@@ -0,0 +1,19 @@
+package com.lc.day07.constaract05;
+
+/**
+ * ClassName: TestPerson
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 16:33
+ * @Version 1.0
+ */
+public class TestPerson {
+
+    public static void main(String[] args) {
+
+        Person person = new Person();
+
+        System.out.println(person);
+
+    }
+}

+ 51 - 0
JavaSE/day07/src/com/lc/day07/constaract06/Dog.java

@@ -0,0 +1,51 @@
+package com.lc.day07.constaract06;
+
+/**
+ * ClassName: Dog
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 16:37
+ * @Version 1.0
+ */
+public class Dog {
+    //名称  年龄   颜色  品种  重量
+    public String name;
+    public int age;
+    public String color;
+    public String type;
+    public double weight;
+
+
+    public Dog(){
+
+    }
+
+    //使用
+    public Dog( String name){
+        //this 关键字
+        //this 在第一行
+        // 调用 其他构造
+        this(name,0,"没毛","土狗",1.0);
+        //this.name = name; //区分同名
+    }
+
+    //完全构造
+    // ALT + insert
+    public Dog(String name, int age, String color, String type, double weight) {
+        this.name = name;
+        this.age = age;
+        this.color = color;
+        this.type = type;
+        this.weight = weight;
+    }
+
+    public String getInfo() {
+        return "Dog{" +
+                "name='" + name + '\'' +
+                ", age=" + age +
+                ", color='" + color + '\'' +
+                ", type='" + type + '\'' +
+                ", weight=" + weight +
+                '}';
+    }
+}

+ 30 - 0
JavaSE/day07/src/com/lc/day07/constaract06/Person.java

@@ -0,0 +1,30 @@
+package com.lc.day07.constaract06;
+
+/**
+ * ClassName: Person
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 16:44
+ * @Version 1.0
+ */
+public class Person {
+
+    public String name;
+    public int age;
+
+    public Person() {
+        //System.out.println(name); this()和this(实参列表)只能声明在构造器首行。
+        this("1");
+    }
+
+    public Person(String name) {
+        this("1",2);
+        this.name = name;
+    }
+
+    public Person(String name, int age) {
+        //this(); //不能出现递归调用。比如,调用自身构造器。
+        this.name = name;
+        this.age = age;
+    }
+}

+ 18 - 0
JavaSE/day07/src/com/lc/day07/constaract06/TestDog.java

@@ -0,0 +1,18 @@
+package com.lc.day07.constaract06;
+
+/**
+ * ClassName: TestDog
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 16:42
+ * @Version 1.0
+ */
+public class TestDog {
+
+    public static void main(String[] args) {
+        Dog dog = new Dog("小黑");
+
+        System.out.println(dog.getInfo());
+    }
+
+}

+ 27 - 0
JavaSE/day07/src/com/lc/day07/exer/Student.java

@@ -0,0 +1,27 @@
+package com.lc.day07.exer;
+
+/**
+ * ClassName: Student
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 9:31
+ * @Version 1.0
+ */
+public class Student {
+    //学号number(int),年级state(int),成绩score(int) 姓名 (name)。
+    public int number;
+    public int state;
+    public int score;
+
+    public String name;
+
+
+    /*
+    一个 getInfo 方法返回 学生详细信息。
+     */
+    public String getInfo(){
+        return "学号:"+number+" 年级:"+state+" 成绩: "+score+" 姓名:"+name;
+    }
+
+
+}

+ 92 - 0
JavaSE/day07/src/com/lc/day07/exer/TestStudent.java

@@ -0,0 +1,92 @@
+package com.lc.day07.exer;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: TestStudent
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 9:31
+ * @Version 1.0
+ */
+public class TestStudent {
+
+    public static void main(String[] args) {
+        //对象
+        TestStudent test = new TestStudent();
+
+        //创建
+        Student[] arr2Length = test.getArr2Length(20);
+
+        //查看
+        test.printArr(arr2Length);
+
+        System.out.println("--------------------------");
+        //根据 年级查看
+        test.printArr2State(arr2Length, 3);
+
+        System.out.println("--------------------------");
+        //排序
+        test.sort(arr2Length);
+        test.printArr(arr2Length);
+
+    }
+
+    /*
+    使用冒泡排序按学生成绩排序,并遍历所有学生信息
+     */
+    public void sort(Student[] arr){
+        for (int i = 0; i < arr.length-1; i++) {
+            for (int k = 0; k < arr.length-1-i; k++) {
+                if ( arr[k].score > arr[k+1].score  ){ //成绩排序
+                    Student temp = arr[k];
+                    arr[k] =arr[k+1];
+                    arr[k+1] = temp;
+                }
+            }
+        }
+    }
+
+    /*
+    根据传入的年级 打印的学生信息。
+     */
+    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[] getArr2Length( int len ){
+        //创建数组
+        Student[] students = new Student[len];
+
+        //遍历 赋值
+        for (int i = 0; i < students.length; i++) {
+            //对象
+            Student student = new Student();
+            //赋值属性
+            student.name ="zs"+(i+1);
+            student.number = (i+1);
+            student.state = (int)(Math.random()*3)+1;
+            student.score = (int)(Math.random()*60)+40;
+            //存储到数组
+            students[i] = student;
+        }
+
+        return students;
+    }
+
+}

+ 31 - 0
JavaSE/day07/src/com/lc/day07/exer1/Test01.java

@@ -0,0 +1,31 @@
+package com.lc.day07.exer1;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 14:27
+ * @Version 1.0
+ */
+public class Test01 {
+    public void swap(Data data){  //data = 0x1122
+        data = new Data();  // 0x1133  x = 0   y = 0
+        int temp = data.x;
+        data.x = data.y;
+        data.y = temp;
+    }
+    public static void main(String[] args) {
+        Test01 tools = new Test01();
+
+        Data data = new Data(); // 0x1122
+        data.x = 1;
+        data.y = 2;
+        System.out.println("交换之前:x = " + data.x +",y = " + data.y);// 1 2
+        tools.swap(data);//调用完之后,x与y的值交换?
+        System.out.println("交换之后:x = " + data.x +",y = " + data.y);// 2 1 1 2 1 2
+    }
+}
+class Data{
+    int x ;
+    int y;
+}

+ 43 - 0
JavaSE/day07/src/com/lc/day07/exer1/Test02.java

@@ -0,0 +1,43 @@
+package com.lc.day07.exer1;
+
+/**
+ * ClassName: Test02
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 14:31
+ * @Version 1.0
+ */
+public class Test02 {
+    public static void main(String args[]) {
+        Test02 test = new Test02();
+        test.first();
+
+        /////////////////////////////
+//        Value v1 = new Value();
+//        v1.i = 25;
+//
+//        Value v2 = new Value();
+//        v2= v1;
+//
+//        System.out.println(v2.i);
+
+
+    }
+    public void first() {
+        int i = 10;
+        Value v = new Value(); //v = 1122 Value i = 25;
+        v.i = 15;
+        second(v, i); //
+        System.out.println(v.i); //
+    }
+    public void second(Value v, int i) { // v = 1133 i = 0
+        i = 0;
+        v.i = 25;
+        Value val = new Value(); // val = 1133 Value i = 35
+        v = val; //1133
+        System.out.println(v.i + " " + i); // v.i = 0 35  i = 0 0 0
+    }
+}
+class Value {
+    int i = 35;
+}

+ 38 - 0
JavaSE/day07/src/com/lc/day07/method03/TestMethod.java

@@ -0,0 +1,38 @@
+package com.lc.day07.method03;
+
+import com.lc.day07.param02.TestMethod02;
+
+/**
+ * ClassName: TestMethod
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 15:04
+ * @Version 1.0
+ */
+public class TestMethod {
+
+    public static void main(String[] args) {
+        new TestMethod().b();
+    }
+
+    //直接递归 :   // StackOverflowError 栈内存溢出。
+
+    public void a(){
+        a();
+    }
+
+
+    //间接
+
+    public void b(){
+        c();
+    }
+    public void c(){
+        d();
+    }
+
+    public void d(){
+        b();
+    }
+
+}

+ 26 - 0
JavaSE/day07/src/com/lc/day07/method03/TestMethod1.java

@@ -0,0 +1,26 @@
+package com.lc.day07.method03;
+
+/**
+ * ClassName: TestMethod
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 15:04
+ * @Version 1.0
+ */
+public class TestMethod1 {
+
+    public static void main(String[] args) {
+        int i = new TestMethod1().sumFunction(10);
+        System.out.println(i);
+    }
+
+    public int sumFunction( int n ){
+
+        if ( n ==  1){
+            return 1;
+        }
+
+        return n + sumFunction(n-1);
+    }
+
+}

+ 27 - 0
JavaSE/day07/src/com/lc/day07/method03/TestMethod3.java

@@ -0,0 +1,27 @@
+package com.lc.day07.method03;
+
+/**
+ * ClassName: TestMethod
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 15:04
+ * @Version 1.0
+ */
+public class TestMethod3 {
+    public static void main(String[] args) {
+
+        int f = f(8);
+        System.out.println(f);
+
+    }
+
+    public static int f( int n ){
+
+        if (n == 1 || n == 2){
+
+            return 1;
+        }
+        return f(n-1) + f(n-2);
+    }
+
+}

+ 56 - 0
JavaSE/day07/src/com/lc/day07/overload01/TestMethod01.java

@@ -0,0 +1,56 @@
+package com.lc.day07.overload01;
+
+/**
+ * ClassName: TestMethod01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 10:58
+ * @Version 1.0
+ */
+public class TestMethod01 {
+
+    public static void main(String[] args) {
+        /*
+            调用的规则:
+             先根据个数匹配
+             在根据类型匹配
+             在找兼容。
+             编译错误
+         */
+
+        TestMethod01 testMethod01 = new TestMethod01();
+        double a = testMethod01.add((byte) 10,10); //10 默认是 int
+        System.out.println(a);
+
+    }
+
+    /**
+     * 两个数组相加
+     * @param a
+     * @param b
+     * @return
+     */
+//    public double add(int a , int b){
+//        return a+b;
+//    }
+
+//    public double add(double a , int b){
+//        return a+b;
+//    }
+
+    public double add(byte a , int b){
+        return a+b;
+    }
+
+    public double add(int b , byte a ){
+        return a+b;
+    }
+
+    public double add(int a , int b , int c){
+        return a+b+c;
+    }
+
+
+
+
+}

+ 32 - 0
JavaSE/day07/src/com/lc/day07/overload01/TestMethod02.java

@@ -0,0 +1,32 @@
+package com.lc.day07.overload01;
+
+/**
+ * ClassName: TestMethod01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 10:58
+ * @Version 1.0
+ */
+public class TestMethod02 {
+
+    public static void main(String[] args) {
+        //调用
+        int add = add(1,2,4);
+        System.out.println(add);
+
+
+    }
+
+
+    /*
+    任意 参数的相加
+     */
+    public static int add( int ... arr   ){
+        int sum = 0;
+        //求和
+        for (int i = 0; i < arr.length; i++) {
+            sum+= arr[i];
+        }
+        return sum;
+    }
+}

+ 33 - 0
JavaSE/day07/src/com/lc/day07/param02/TestMethod01.java

@@ -0,0 +1,33 @@
+package com.lc.day07.param02;
+
+/**
+ * ClassName: TestMethod01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 13:45
+ * @Version 1.0
+ */
+public class TestMethod01 {
+
+    public static void main(String[] args) {
+        TestMethod01 testMethod01 = new TestMethod01();
+
+        int a = 5;
+        int b = 10;
+
+        System.out.println("a:"+a+" b:"+b); // a = 5  b = 10
+
+        testMethod01.change(a,b);
+
+        System.out.println("a:"+a+" b:"+b); // a = 10 5 5  b = 20 10 10
+
+    }
+
+    public void change( int a , int b ){
+        a = 10;
+        b = 20;
+    }
+
+
+
+}

+ 31 - 0
JavaSE/day07/src/com/lc/day07/param02/TestMethod02.java

@@ -0,0 +1,31 @@
+package com.lc.day07.param02;
+
+/**
+ * ClassName: TestMethod01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/2 13:45
+ * @Version 1.0
+ */
+public class TestMethod02 {
+
+    public static void main(String[] args) {
+        TestMethod02 testMethod01 = new TestMethod02();
+
+        Number number = new Number(); //0x1122
+        number.x = 5;
+        number.y = 10;
+        System.out.println("x:"+number.x+" y:"+number.y); // 5 10  ?  0 0
+        testMethod01.change(number);
+        System.out.println("x:"+number.x+" y:"+number.y); // 5 10   50  100  50  100
+
+    }
+    public void change(Number number  ){
+        number.x = 50;
+        number.y = 100;
+    }
+}
+class Number {
+    int x;
+    int y;
+}

+ 12 - 0
JavaSE/day08/day08.iml

@@ -0,0 +1,12 @@
+<?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" />
+    <orderEntry type="library" name="java_maven-1.0-SNAPSHOT" level="project" />
+  </component>
+</module>

BIN
JavaSE/day08/lib/java_maven-1.0-SNAPSHOT.jar


+ 24 - 0
JavaSE/day08/src/com/lc/day08/enc01/A.java

@@ -0,0 +1,24 @@
+package com.lc.day08.enc01;
+
+/**
+ * ClassName: Person
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 9:36
+ * @Version 1.0
+ */
+public class A {
+
+    //public 共有的 任意
+
+    // 默认的
+
+    //private 本类中访问。
+    protected int a;
+
+    // 私有的。
+    public void main(String[] args) {
+        System.out.println(a);
+    }
+
+}

+ 24 - 0
JavaSE/day08/src/com/lc/day08/enc02/B.java

@@ -0,0 +1,24 @@
+package com.lc.day08.enc02;
+
+import com.lc.day08.enc01.A;
+
+/**
+ * ClassName: B
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 9:36
+ * @Version 1.0
+ */
+public class B {
+
+
+    public static void main(String[] args) {
+
+        A a = new A();
+
+        //默认 不同包 下  不可以访问
+        //System.out.println(a.a);
+
+        //System.out.println(a.a);
+    }
+}

+ 81 - 0
JavaSE/day08/src/com/lc/day08/enc03/Person.java

@@ -0,0 +1,81 @@
+package com.lc.day08.enc03;
+
+/**
+ * ClassName: Person
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 10:00
+ * @Version 1.0
+ */
+public class Person {
+
+    //私有化属性
+    private String name;
+    private int age;
+
+    public Person() {
+    }
+
+    public Person( int age) {
+        //age 0-150
+        boolean b = checkAge(age);
+        if (b){
+            this.age = age;
+        }
+
+    }
+
+    public Person(String name, int age) {
+        this.name = name;
+        //age 0-150
+        boolean b = checkAge(age);
+        if (b){
+            this.age = age;
+        }
+
+    }
+
+    //访问方式
+    public String getName(){
+        return name;
+    }
+
+    public void setName( String name ){
+        //this
+        this.name = name;
+    }
+
+
+    public int getAge(){
+        return age;
+    }
+
+    public void setAge(int age){
+        //age 0-150
+        boolean b = checkAge(age);
+        if (b){
+            this.age = age;
+        }
+    }
+
+    //封装方法 提高复用性。
+    private boolean checkAge(int age){
+
+        boolean flag = true;
+        if ( age < 0 || age > 150  ){
+            System.out.println("年龄不符合,赋值不成功");
+            //抛出异常
+            flag = false;
+        }
+        return flag;
+    }
+
+
+    @Override
+    public String toString() {
+        return "Person{" +
+                "name='" + name + '\'' +
+                ", age=" + age +
+                '}';
+    }
+}

+ 42 - 0
JavaSE/day08/src/com/lc/day08/enc03/TestPerson.java

@@ -0,0 +1,42 @@
+package com.lc.day08.enc03;
+
+/**
+ * ClassName: TestPerson
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 10:05
+ * @Version 1.0
+ */
+public class TestPerson {
+
+    public static void main(String[] args) {
+
+        Person person = new Person();
+
+        //person.setAge(99);
+        //person.setAge(-1);
+        person.setAge(10);
+        //
+        person.setName("坤坤");
+
+        //查看
+        System.out.println(person);
+
+
+        //测试
+        System.out.println("-----------------------------");
+
+        Person p1 = new Person();
+
+        p1.setAge(-1);
+        p1.setName("凡凡");
+
+        System.out.println(p1.toString());
+
+        Person p2 = new Person(-1);
+
+        System.out.println(p2);
+
+
+    }
+}

+ 25 - 0
JavaSE/day08/src/com/lc/day08/enc04/Person.java

@@ -0,0 +1,25 @@
+package com.lc.day08.enc04;
+
+/**
+ * ClassName: Person
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 10:00
+ * @Version 1.0
+ */
+public class Person {
+
+    private static final Person PERSON = new Person();
+
+    //需要当前类 在内存中只有一份。
+    private Person() {
+
+    }
+
+    //static
+    public static Person getPerson(){
+        return PERSON;
+    }
+
+
+}

+ 40 - 0
JavaSE/day08/src/com/lc/day08/enc04/TestPerson.java

@@ -0,0 +1,40 @@
+package com.lc.day08.enc04;
+
+/**
+ * ClassName: TestPersong
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 10:21
+ * @Version 1.0
+ */
+public class TestPerson {
+
+
+    public static void main(String[] args) {
+
+
+//        Person person1 = new Person();
+//        Person person2 = new Person();
+//
+//        // 堆内存地址 不同
+//        System.out.println(person1 == person2); // false
+
+        // 返回true
+
+        // 不让 new
+
+        // 提供共有的
+
+        // static
+
+        Person person1 = Person.getPerson();
+        Person person2 = Person.getPerson();
+
+        System.out.println(person1 == person2); // true
+
+        String kk = "kunkun1";
+
+        boolean equals = "kunkun".equals(kk);
+        System.out.println(equals);
+    }
+}

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

@@ -0,0 +1,28 @@
+package com.lc.day08.enc05;
+
+/**
+ * ClassName: Test
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 11:19
+ * @Version 1.0
+ */
+public class Test {
+
+    public static void main(String[] args) {
+
+        User u1 = new User();
+        u1.setUserName("admin");
+        u1.setPassWord("111111");
+
+        User u2 = new User();
+        u2.setUserName("admin");
+        u2.setPassWord("111112");
+
+        //比较
+        boolean login = u1.login(u2.getUserName(), u2.getPassWord());
+
+        System.out.println(login);
+
+    }
+}

+ 40 - 0
JavaSE/day08/src/com/lc/day08/enc05/User.java

@@ -0,0 +1,40 @@
+package com.lc.day08.enc05;
+
+/**
+ * ClassName: User
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 11:15
+ * @Version 1.0
+ */
+public class User {
+
+    private String userName;
+
+    private String passWord;
+
+    //快捷键
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getPassWord() {
+        return passWord;
+    }
+
+    public void setPassWord(String passWord) {
+        this.passWord = passWord;
+    }
+
+    //判断当前用户和另外一个用户的密码和用户是否相同
+    public boolean login( String userName , String passWord ){
+        //比较
+        // u1 调用 login userName 代表u1的用户名。
+       return this.userName.equals(userName) && this.passWord.equals(passWord);
+    }
+
+}

+ 92 - 0
JavaSE/day08/src/com/lc/day08/exer01/CreditCard.java

@@ -0,0 +1,92 @@
+package com.lc.day08.exer01;
+
+/**
+ * ClassName: CreditCard
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 15:47
+ * @Version 1.0
+ */
+public class CreditCard extends DepositCard{
+
+    //本月可透支总额度,本月已透支金额
+    private double overMoney; //以透支
+
+    private double money;  //额度
+
+    @Override
+    public void withdraw(double money) {
+        //- 取款金额超过账户余额+本月还可透支额度,提示超过可透支额度
+        double max = getBanlance() + this.money;
+        if ( money > max ){
+            System.out.println("超过可透支额度");
+            return;
+        }
+        //- 取款金额在账户余额范围内,不用透支
+        if ( money < getBanlance( ) ){
+            //获取账户余额
+            int banlance = getBanlance();
+            //减去账户余额 重新赋值
+            setBanlance((int)(banlance - money));  ;
+        } else if ( money  > getBanlance()  &&  money < max  ){
+            //- 取款金额超过账户余额但在可透支范围内,需要透支
+
+            //额度 - money - 余额
+            double v = money - getBanlance();
+            //余额 = 0
+            setBanlance(0);
+            //透支
+            overMoney = v;
+        }
+    }
+
+    @Override
+    public void save(double money) {
+        //- 存款金额不能为负数,否则提示存款金额不能为负数
+        if ( money < 0 ){
+            System.out.println("金额不能为负数");
+            return;
+        }
+        //- 本次存款金额只够偿还部分已透支金额
+        if ( money < overMoney ){
+            overMoney -= money;
+        }
+        //- 本次存款金额除了偿还透支金额,还有剩余
+        if ( money > overMoney ){
+
+            int c = getBanlance();
+            setBanlance ((int) (money - overMoney + c)); ;
+
+            overMoney = 0;
+        }
+    }
+
+
+    public double getOverMoney() {
+        return overMoney;
+    }
+
+    public void setOverMoney(double overMoney) {
+        this.overMoney = overMoney;
+    }
+
+    public double getMoney() {
+        return money;
+    }
+
+    public void setMoney(double money) {
+        this.money = money;
+    }
+
+
+    @Override
+    public String getInfo() {
+        return "CreditCard{" +
+                "overMoney=" + overMoney +
+                ", money=" + money +
+                '}' +"DepositCard{" +
+                "account='" + getAccount() + '\'' +
+                ", banlance=" + getBanlance() +
+                '}';
+    }
+}

+ 67 - 0
JavaSE/day08/src/com/lc/day08/exer01/DepositCard.java

@@ -0,0 +1,67 @@
+package com.lc.day08.exer01;
+
+/**
+ * ClassName: DepositCard
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 15:41
+ * @Version 1.0
+ */
+public class DepositCard {
+
+    private String account;
+    private int banlance;
+
+    /**
+     * 取款方法
+     * @param money
+     */
+    public void withdraw(double money){
+        if (money < 0){
+            System.out.println("取款不能为负数");
+            return;
+        }
+
+        if (money > banlance){
+            System.out.println("余额不足");
+            return;
+        }
+        banlance -= money;
+    }
+
+    /**
+     * 存款
+     * @param money
+     */
+    public void save(double money){
+        if (money < 0){
+            System.out.println("存款不能为负数");
+            return;
+        }
+
+        banlance += money;
+    }
+
+    public String getInfo(){
+        return "DepositCard{" +
+                "account='" + account + '\'' +
+                ", banlance=" + banlance +
+                '}';
+    }
+
+    public String getAccount() {
+        return account;
+    }
+
+    public void setAccount(String account) {
+        this.account = account;
+    }
+
+    public int getBanlance() {
+        return banlance;
+    }
+
+    public void setBanlance(int banlance) {
+        this.banlance = banlance;
+    }
+}

+ 54 - 0
JavaSE/day08/src/com/lc/day08/exer01/Test01.java

@@ -0,0 +1,54 @@
+package com.lc.day08.exer01;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 15:40
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) {
+
+        DepositCard card = new DepositCard();
+        card.setBanlance(1000);
+        card.setAccount("10001");
+
+        System.out.println(card.getInfo());
+
+        //取款
+        card.withdraw(200);
+
+        System.out.println(card.getInfo());
+
+        //取款
+        card.withdraw(900);
+        System.out.println(card.getInfo());
+        System.out.println("-------------------------------------");
+
+        CreditCard creditCard = new CreditCard();
+
+        creditCard.setBanlance(1000);
+        creditCard.setMoney(1000);
+        creditCard.setAccount("10002");
+
+        System.out.println(creditCard.getInfo());
+
+        creditCard.withdraw(800);
+
+        System.out.println(creditCard.getInfo());
+
+        creditCard.withdraw(800);
+
+        System.out.println(creditCard.getInfo());
+
+        creditCard.save(800);
+
+        System.out.println(creditCard.getInfo());
+
+        creditCard.save(800);
+
+        System.out.println(creditCard.getInfo());
+    }
+}

+ 102 - 0
JavaSE/day08/src/com/lc/day08/exer02/CreditCard.java

@@ -0,0 +1,102 @@
+package com.lc.day08.exer02;
+
+/**
+ * ClassName: CreditCard
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 15:47
+ * @Version 1.0
+ */
+public class CreditCard extends DepositCard {
+
+
+    //本月可透支总额度,本月已透支金额
+    private double overMoney; //以透支
+
+    private double money;  //额度
+
+    public CreditCard() {
+    }
+
+    public CreditCard(String account, int banlance, double overMoney, double money) {
+        super(account, banlance);
+        this.overMoney = overMoney;
+        this.money = money;
+    }
+
+    @Override
+    public void withdraw(double money) {
+        //- 取款金额超过账户余额+本月还可透支额度,提示超过可透支额度
+        double max = getBanlance() + this.money;
+        if ( money > max ){
+            System.out.println("超过可透支额度");
+            return;
+        }
+        //- 取款金额在账户余额范围内,不用透支
+        if ( money < getBanlance( ) ){
+            //获取账户余额
+            int banlance = getBanlance();
+            //减去账户余额 重新赋值
+            setBanlance((int)(banlance - money));  ;
+        } else if ( money  > getBanlance()  &&  money < max  ){
+            //- 取款金额超过账户余额但在可透支范围内,需要透支
+
+            //额度 - money - 余额
+            double v = money - getBanlance();
+            //余额 = 0
+            setBanlance(0);
+            //透支
+            overMoney = v;
+        }
+    }
+
+    @Override
+    public void save(double money) {
+        //- 存款金额不能为负数,否则提示存款金额不能为负数
+        if ( money < 0 ){
+            System.out.println("金额不能为负数");
+            return;
+        }
+        //- 本次存款金额只够偿还部分已透支金额
+        if ( money < overMoney ){
+            overMoney -= money;
+        }
+        //- 本次存款金额除了偿还透支金额,还有剩余
+        if ( money > overMoney ){
+
+            int c = getBanlance();
+            setBanlance ((int) (money - overMoney + c)); ;
+
+            overMoney = 0;
+        }
+    }
+
+
+    public double getOverMoney() {
+        return overMoney;
+    }
+
+    public void setOverMoney(double overMoney) {
+        this.overMoney = overMoney;
+    }
+
+    public double getMoney() {
+        return money;
+    }
+
+    public void setMoney(double money) {
+        this.money = money;
+    }
+
+
+    @Override
+    public String getInfo() {
+        return "CreditCard{" +
+                "overMoney=" + overMoney +
+                ", money=" + money +
+                '}' +"DepositCard{" +
+                "account='" + getAccount() + '\'' +
+                ", banlance=" + getBanlance() +
+                '}';
+    }
+}

+ 75 - 0
JavaSE/day08/src/com/lc/day08/exer02/DepositCard.java

@@ -0,0 +1,75 @@
+package com.lc.day08.exer02;
+
+/**
+ * ClassName: DepositCard
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 15:41
+ * @Version 1.0
+ */
+public class DepositCard {
+
+    private String account;
+    private int banlance;
+
+    public DepositCard() {
+    }
+
+    public DepositCard(String account, int banlance) {
+        this.account = account;
+        this.banlance = banlance;
+    }
+
+    /**
+     * 取款方法
+     * @param money
+     */
+    public void withdraw(double money){
+        if (money < 0){
+            System.out.println("取款不能为负数");
+            return;
+        }
+
+        if (money > banlance){
+            System.out.println("余额不足");
+            return;
+        }
+        banlance -= money;
+    }
+
+    /**
+     * 存款
+     * @param money
+     */
+    public void save(double money){
+        if (money < 0){
+            System.out.println("存款不能为负数");
+            return;
+        }
+
+        banlance += money;
+    }
+
+    public String getInfo(){
+        return "DepositCard{" +
+                "account='" + account + '\'' +
+                ", banlance=" + banlance +
+                '}';
+    }
+
+    public String getAccount() {
+        return account;
+    }
+
+    public void setAccount(String account) {
+        this.account = account;
+    }
+
+    public int getBanlance() {
+        return banlance;
+    }
+
+    public void setBanlance(int banlance) {
+        this.banlance = banlance;
+    }
+}

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

@@ -0,0 +1,18 @@
+package com.lc.day08.exer02;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 15:40
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) {
+
+        DepositCard depositCard = new DepositCard("1001", 1000);
+
+        CreditCard creditCard = new CreditCard("10002", 1000, 1000, 0);
+    }
+}

+ 44 - 0
JavaSE/day08/src/com/lc/day08/inherit01/Animal.java

@@ -0,0 +1,44 @@
+package com.lc.day08.inherit01;
+
+/**
+ * ClassName: Animal
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 11:35
+ * @Version 1.0
+ */
+public class Animal {
+
+    public String name;
+    public int age;
+
+
+    public void eatting(){
+        System.out.println("eatting");
+    }
+
+    public void sleep(){
+        System.out.println("sleep");
+    }
+
+
+    public String getInfo(){
+        return "name:"+name + "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;
+    }
+}

+ 17 - 0
JavaSE/day08/src/com/lc/day08/inherit01/Cat.java

@@ -0,0 +1,17 @@
+package com.lc.day08.inherit01;
+
+/**
+ * ClassName: Cat
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 11:36
+ * @Version 1.0
+ */
+public class Cat  extends Animal {
+
+    public void catchMouse(){
+        System.out.println("catchMouse");
+    }
+
+
+}

+ 23 - 0
JavaSE/day08/src/com/lc/day08/inherit01/Dog.java

@@ -0,0 +1,23 @@
+package com.lc.day08.inherit01;
+
+/**
+ * ClassName: Dog
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 11:37
+ * @Version 1.0
+ */
+public class Dog extends Animal {
+
+    public int weight ;
+
+    public void lookHome(){
+        System.out.println(name + ": lookHome ");
+    }
+
+
+    public String getDogInfo() {
+        //继承的方法
+        return getInfo()+"weight:"+weight;
+    }
+}

+ 36 - 0
JavaSE/day08/src/com/lc/day08/inherit01/Test01.java

@@ -0,0 +1,36 @@
+package com.lc.day08.inherit01;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 11:40
+ * @Version 1.0
+ */
+public class Test01 {
+    public static void main(String[] args) {
+
+        Cat cat = new Cat();
+
+        //属性 继承的属性
+        cat.name = "tom";
+        cat.age = 1;
+
+        //继承方法
+        System.out.println(cat.getInfo());
+
+
+        //Dog
+        Dog dog = new Dog();
+
+        dog.setAge(10);
+        dog.setName("大黄");
+        dog.weight=20;
+
+        // 方法
+        System.out.println(dog.getDogInfo());
+
+
+        //继承属性 继承方法。
+    }
+}

+ 64 - 0
JavaSE/day08/src/com/lc/day08/inherit02/Test01.java

@@ -0,0 +1,64 @@
+package com.lc.day08.inherit02;
+
+/**
+ * ClassName: A
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 13:39
+ * @Version 1.0
+ */
+public class Test01 {
+}
+
+class A{
+    private int a;
+
+    public int getA() {
+        return a;
+    }
+
+    public void setA(int a) {
+        this.a = a;
+    }
+
+    private void m1(){
+
+    }
+}
+
+class B extends A {
+
+    public void m2(){
+        //继承非私有 的属性和方法
+        setA(1);
+        System.out.println(getA());
+    }
+
+    public static void main(String[] args) {
+        B b = new B();
+        b.m2();
+    }
+
+}
+
+//class C  extends A,B{ // java 支持单继承
+//
+//}
+
+// 多层继承
+
+class C extends  B {
+
+    public void m3(){
+        //继承非私有 的属性和方法
+        setA(1);
+        System.out.println(getA());
+    }
+
+}
+
+class D extends A { //继承同一个类。
+
+}
+
+

+ 26 - 0
JavaSE/day08/src/com/lc/day08/methodover01/Phone.java

@@ -0,0 +1,26 @@
+package com.lc.day08.methodover01;
+
+/**
+ * ClassName: Phone
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 13:53
+ * @Version 1.0
+ */
+public class Phone {
+
+    //属性 很复杂。
+
+    public void send(){
+        System.out.println("发送文字");
+    }
+
+    public void call(){
+        System.out.println("打电话");
+        System.out.println("信号 不好");
+    }
+
+    public void new_(){
+        System.out.println("阅读新闻");
+    }
+}

+ 36 - 0
JavaSE/day08/src/com/lc/day08/methodover01/SmartPhone.java

@@ -0,0 +1,36 @@
+package com.lc.day08.methodover01;
+
+/**
+ * ClassName: SmartPhone
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 13:56
+ * @Version 1.0
+ */
+public class SmartPhone extends Phone{
+
+    //优化
+
+    //对父类的方法重写
+    @Override
+    // @Override 验证是否是重写方法
+    public void send(){
+        System.out.println("发送文字 配合 图片 ");
+    }
+
+    //重写
+    // 快捷键
+    //
+
+
+    @Override
+    public void call() {
+        System.out.println("打电话");
+        System.out.println("信号 很好");
+    }
+
+    @Override
+    public void new_() {
+        System.out.println("阅读新闻 响应快速 ");
+    }
+}

+ 20 - 0
JavaSE/day08/src/com/lc/day08/methodover01/Test01.java

@@ -0,0 +1,20 @@
+package com.lc.day08.methodover01;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 13:53
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) {
+        SmartPhone smartPhone = new SmartPhone();
+
+        smartPhone.call();
+        smartPhone.send();
+        smartPhone.new_();
+    }
+
+}

+ 11 - 0
JavaSE/day08/src/com/lc/day08/methodover02/A.java

@@ -0,0 +1,11 @@
+package com.lc.day08.methodover02;
+
+/**
+ * ClassName: A
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 14:35
+ * @Version 1.0
+ */
+public class A { // 范围大
+}

+ 12 - 0
JavaSE/day08/src/com/lc/day08/methodover02/B.java

@@ -0,0 +1,12 @@
+package com.lc.day08.methodover02;
+
+/**
+ * ClassName: B
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 14:35
+ * @Version 1.0
+ */
+public class B extends A{  //范围小
+
+}

+ 33 - 0
JavaSE/day08/src/com/lc/day08/methodover02/Father.java

@@ -0,0 +1,33 @@
+package com.lc.day08.methodover02;
+
+/**
+ * ClassName: Father
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 14:30
+ * @Version 1.0
+ */
+public class Father {
+
+    //方法重写时,子类的权限修饰符必须要大于或者等于父类的权限修饰符。
+    void method(){
+
+    }
+
+    //方法重写时,子类的返回值类型必须要小于或者 等于父类的返回值类型(基本类型 返回值类型相同 )。
+
+    //引用类型
+    // B 继承 A  A类类型大于 B 类型。
+    // 在父类中 如果B  在子类中 只能是 B; 小于或者 等于父类的返回值
+    // 在父类中 如果 A  在子类中 可以 A 或者 B;
+    public int method2(){
+
+        return 1;
+    }
+
+    public A method3(){
+
+        return null;
+    }
+
+}

+ 22 - 0
JavaSE/day08/src/com/lc/day08/methodover02/Son.java

@@ -0,0 +1,22 @@
+package com.lc.day08.methodover02;
+
+/**
+ * ClassName: Son
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 14:30
+ * @Version 1.0
+ */
+public class Son extends Father{
+
+    @Override
+    public void method() {
+
+    }
+
+    @Override
+    public B method3( ) {
+
+        return null;
+    }
+}

+ 20 - 0
JavaSE/day08/src/com/lc/day08/protected01/Father.java

@@ -0,0 +1,20 @@
+package com.lc.day08.protected01;
+
+import com.lc.day08.methodover02.A;
+
+/**
+ * ClassName: Father
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 14:30
+ * @Version 1.0
+ */
+public class Father {
+
+    protected int a;
+
+    protected void a(){
+
+    }
+
+}

+ 29 - 0
JavaSE/day08/src/com/lc/day08/protected02/Son.java

@@ -0,0 +1,29 @@
+package com.lc.day08.protected02;
+
+import com.lc.day08.methodover02.B;
+import com.lc.day08.protected01.Father;
+import com.lc.maven.HelloWorld;
+
+/**
+ * ClassName: Son
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 14:30
+ * @Version 1.0
+ */
+public class Son extends Father {
+
+    public void m2(){
+        //属性
+        System.out.println(a);
+        //方法
+        a();
+
+        //不同包子类可以使用
+    }
+
+    @Override
+    public void a() {
+        super.a();
+    }
+}

+ 20 - 0
JavaSE/day08/src/com/lc/day08/super02/Person.java

@@ -0,0 +1,20 @@
+package com.lc.day08.super02;
+
+/**
+ * ClassName: Person
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 16:33
+ * @Version 1.0
+ */
+public class Person {
+
+    int age = 10;
+
+
+
+    public void p1(){
+        System.out.println("Person");
+    }
+
+}

+ 18 - 0
JavaSE/day08/src/com/lc/day08/super02/SmallStudent.java

@@ -0,0 +1,18 @@
+package com.lc.day08.super02;
+
+/**
+ * ClassName: SmallStudent
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 16:38
+ * @Version 1.0
+ */
+public class SmallStudent extends Student{
+
+    public void s(){
+        // this 调用属性 或者方法。现在本类中 找 没有取父类,在向上父类,一直 没有编译问题
+        this.p1();
+        // super 调用属性 或者方法。现在父类中 找 没有取父类,在向上父类,一直 没有编译问题
+        super.p1();
+    }
+}

+ 33 - 0
JavaSE/day08/src/com/lc/day08/super02/Student.java

@@ -0,0 +1,33 @@
+package com.lc.day08.super02;
+
+
+/**
+ * ClassName: Student
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 16:26
+ * @Version 1.0
+ */
+public class Student extends Person {
+
+    int age = 20; // 不推荐
+
+
+    public void m1(){
+        //super 属性
+        // super.属性
+
+        System.out.println(age);
+        System.out.println(super.age);
+    }
+
+
+    @Override
+    public void p1() {
+
+        //super 方法
+        //super.方法
+        //super.p1();
+        System.out.println("Student");
+    }
+}

+ 23 - 0
JavaSE/day08/src/com/lc/day08/super02/Test.java

@@ -0,0 +1,23 @@
+package com.lc.day08.super02;
+
+/**
+ * ClassName: Test
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 16:34
+ * @Version 1.0
+ */
+public class Test {
+    public static void main(String[] args) {
+        Student student = new Student();
+
+        student.m1();
+        student.p1();
+
+        System.out.println("------------");
+
+        SmallStudent smallStudent = new SmallStudent();
+
+        smallStudent.s();
+    }
+}

+ 15 - 0
JavaSE/day08/src/com/lc/day08/super03/Father.java

@@ -0,0 +1,15 @@
+package com.lc.day08.super03;
+
+/**
+ * ClassName: Father
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 16:47
+ * @Version 1.0
+ */
+public class Father {
+
+    public Father(  ) {
+        super();
+    }
+}

+ 24 - 0
JavaSE/day08/src/com/lc/day08/super03/Son.java

@@ -0,0 +1,24 @@
+package com.lc.day08.super03;
+
+/**
+ * ClassName: Son
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 16:47
+ * @Version 1.0
+ */
+public class Son extends Father{
+
+    public Son() {
+        //super调用父类的构造
+        super(); //无参数的构造
+
+        // super(1); //需要匹配父类有参数的
+        // super在第一行。
+        // this 第一行  不可以同时存在。
+        // 没有写 super() 默认提供  super()
+        // 当前对象初始化 必须包装父类初始化。
+
+        //System.out.println(super);
+    }
+}

+ 22 - 0
JavaSE/day08/src/com/lc/day08/this01/Person.java

@@ -0,0 +1,22 @@
+package com.lc.day08.this01;
+
+import java.net.SocketTimeoutException;
+
+/**
+ * ClassName: Person
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 16:23
+ * @Version 1.0
+ */
+public class Person {
+
+    public void login(){
+        System.out.println("this:"+this);
+    }
+
+
+    public Person() {
+        System.out.println("this:"+ this);
+    }
+}

+ 22 - 0
JavaSE/day08/src/com/lc/day08/this01/Student.java

@@ -0,0 +1,22 @@
+package com.lc.day08.this01;
+
+/**
+ * ClassName: Student
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 16:26
+ * @Version 1.0
+ */
+public class Student extends Person {
+
+    public void m1(){
+        this.login();
+        login();
+
+        //一样效果
+    }
+
+    public Student() {
+        super();
+    }
+}

+ 26 - 0
JavaSE/day08/src/com/lc/day08/this01/Test.java

@@ -0,0 +1,26 @@
+package com.lc.day08.this01;
+
+/**
+ * ClassName: Test
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/12/9 16:24
+ * @Version 1.0
+ */
+public class Test {
+
+    public static void main(String[] args) {
+        Person p1 = new Person();
+
+        //当前对象。
+        System.out.println("p1:"+p1);
+        p1.login();
+
+        System.out.println("-----------------------------");
+
+        Student student = new Student();
+
+        // thiscom.lc.day08.this01.Student@7cca494b
+        // this 指向 对象。 对象 和 类 之间关系。
+    }
+}

Некоторые файлы не были показаны из-за большого количества измененных файлов