xerga 2 yıl önce
ebeveyn
işleme
a98d22dd5e
28 değiştirilmiş dosya ile 948 ekleme ve 31 silme
  1. 9 0
      .idea/VIP25.iml
  2. 9 0
      .idea/libraries/jihuo_tool.xml
  3. 6 0
      .idea/misc.xml
  4. 11 0
      .idea/modules.xml
  5. 6 0
      .idea/vcs.xml
  6. 46 0
      .idea/workspace.xml
  7. 1 0
      01-JavaSe/.idea/modules.xml
  8. 0 10
      01-JavaSe/.idea/runConfigurations.xml
  9. 124 0
      01-JavaSe/.idea/uiDesigner.xml
  10. 1 11
      01-JavaSe/day05/day05.iml
  11. 0 10
      01-JavaSe/day06/day06.iml
  12. 21 0
      01-JavaSe/day07/day07.iml
  13. 223 0
      01-JavaSe/day07/src/com/lovecoding/day07/Test01Arr01.java
  14. 135 0
      01-JavaSe/day07/src/com/lovecoding/day07/Test01Arr02.java
  15. 46 0
      01-JavaSe/day07/src/com/lovecoding/day07/Test01Arr03.java
  16. 63 0
      01-JavaSe/day07/src/com/lovecoding/day07/Test01Arr04.java
  17. 70 0
      01-JavaSe/day07/src/com/lovecoding/day07/Test01Arr05.java
  18. 66 0
      01-JavaSe/day07/src/com/lovecoding/day07/Test01Arr06.java
  19. 77 0
      01-JavaSe/day07/src/com/lovecoding/day07/Test01Arr07.java
  20. 34 0
      01-JavaSe/day07/src/com/lovecoding/day07/Test01Arr08.java
  21. BIN
      01-JavaSe/out/production/day07/com/lovecoding/day07/Test01Arr01.class
  22. BIN
      01-JavaSe/out/production/day07/com/lovecoding/day07/Test01Arr02.class
  23. BIN
      01-JavaSe/out/production/day07/com/lovecoding/day07/Test01Arr03.class
  24. BIN
      01-JavaSe/out/production/day07/com/lovecoding/day07/Test01Arr04.class
  25. BIN
      01-JavaSe/out/production/day07/com/lovecoding/day07/Test01Arr05.class
  26. BIN
      01-JavaSe/out/production/day07/com/lovecoding/day07/Test01Arr06.class
  27. BIN
      01-JavaSe/out/production/day07/com/lovecoding/day07/Test01Arr07.class
  28. BIN
      01-JavaSe/out/production/day07/com/lovecoding/day07/Test01Arr08.class

+ 9 - 0
.idea/VIP25.iml

@@ -0,0 +1,9 @@
+<?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$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 9 - 0
.idea/libraries/jihuo_tool.xml

@@ -0,0 +1,9 @@
+<component name="libraryTable">
+  <library name="jihuo-tool">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/00-Tools/03-集成开发环境-IDEA/IDEA 2022.1 注册文档/jihuo-tool.zip!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES />
+  </library>
+</component>

+ 6 - 0
.idea/misc.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>

+ 11 - 0
.idea/modules.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/01-JavaSe/01-JavaSe.iml" filepath="$PROJECT_DIR$/01-JavaSe/01-JavaSe.iml" />
+      <module fileurl="file://$PROJECT_DIR$/.idea/VIP25.iml" filepath="$PROJECT_DIR$/.idea/VIP25.iml" />
+      <module fileurl="file://$PROJECT_DIR$/01-JavaSe/day05/day05.iml" filepath="$PROJECT_DIR$/01-JavaSe/day05/day05.iml" />
+      <module fileurl="file://$PROJECT_DIR$/01-JavaSe/day06/day06.iml" filepath="$PROJECT_DIR$/01-JavaSe/day06/day06.iml" />
+    </modules>
+  </component>
+</project>

+ 6 - 0
.idea/vcs.xml

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

+ 46 - 0
.idea/workspace.xml

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ChangeListManager">
+    <list default="true" id="873a0582-9da2-43c2-a3b9-38daae56415a" name="Changes" comment="">
+      <change beforePath="$PROJECT_DIR$/01-JavaSe/01-JavaSe.iml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/01-JavaSe/day05/day05.iml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/01-JavaSe/day06/day06.iml" beforeDir="false" />
+    </list>
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="Git.Settings">
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
+  </component>
+  <component name="ProjectId" id="2QOufjBBeEhrgdju0JXlAlnAF5E" />
+  <component name="ProjectViewState">
+    <option name="hideEmptyMiddlePackages" value="true" />
+    <option name="showLibraryContents" value="true" />
+  </component>
+  <component name="PropertiesComponent"><![CDATA[{
+  "keyToString": {
+    "RunOnceActivity.OpenProjectViewOnStart": "true",
+    "RunOnceActivity.ShowReadmeOnStart": "true",
+    "WebServerToolWindowFactoryState": "false",
+    "last_opened_file_path": "C:/LoveCoding/VIP-25/code/VIP25/01-JavaSe",
+    "vue.rearranger.settings.migration": "true"
+  }
+}]]></component>
+  <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="873a0582-9da2-43c2-a3b9-38daae56415a" name="Changes" comment="" />
+      <created>1685237054280</created>
+      <option name="number" value="Default" />
+      <option name="presentableId" value="Default" />
+      <updated>1685237054280</updated>
+      <workItem from="1685237056859" duration="10000" />
+    </task>
+    <servers />
+  </component>
+  <component name="TypeScriptGeneratedFilesManager">
+    <option name="version" value="3" />
+  </component>
+</project>

+ 1 - 0
01-JavaSe/.idea/modules.xml

@@ -4,6 +4,7 @@
     <modules>
       <module fileurl="file://$PROJECT_DIR$/01-JavaSe.iml" filepath="$PROJECT_DIR$/01-JavaSe.iml" />
       <module fileurl="file://$PROJECT_DIR$/day05/day05.iml" filepath="$PROJECT_DIR$/day05/day05.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day07/day07.iml" filepath="$PROJECT_DIR$/day07/day07.iml" />
     </modules>
   </component>
 </project>

+ 0 - 10
01-JavaSe/.idea/runConfigurations.xml

@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="RunConfigurationProducerService">
-    <option name="ignoredProducers">
-      <set>
-        <option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
-      </set>
-    </option>
-  </component>
-</project>

+ 124 - 0
01-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>

+ 1 - 11
01-JavaSe/day05/day05.iml

@@ -5,17 +5,7 @@
     <content url="file://$MODULE_DIR$">
       <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
     </content>
-    <orderEntry type="jdk" jdkName="17" jdkType="JavaSDK" />
+    <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>

+ 0 - 10
01-JavaSe/day06/day06.iml

@@ -7,15 +7,5 @@
     </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>

+ 21 - 0
01-JavaSe/day07/day07.iml

@@ -0,0 +1,21 @@
+<?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="jdk" jdkName="17" jdkType="JavaSDK" />
+    <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>

+ 223 - 0
01-JavaSe/day07/src/com/lovecoding/day07/Test01Arr01.java

@@ -0,0 +1,223 @@
+package com.lovecoding.day07;
+
+import org.junit.Test;
+
+/**
+ * ClassName: Test01Arr01
+ * Package: com.lovecoding.day07
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/5/28 9:25
+ * @Version 1.0
+ */
+public class Test01Arr01 {
+
+    /*
+    **举例8:评委打分**
+    分析以下需求,并用代码实现:
+    (1)在编程竞赛中,有10位评委为参赛的选手打分,分数分别为:5,4,6,8,9,0,1,2,7,3
+    (2)求选手的最后得分(去掉一个最高分和一个最低分后其余8位评委打分的平均值)
+     */
+    @Test
+    public void test09(){
+        //遍历数组获取最大值和最小的索引
+        int[] arr = {5,4,6,8,9,0,1,2,7,3};
+
+        int minindex = 0;
+        int maxindex = 0;
+
+        int max = arr[0];
+        int min = arr[0];
+
+        for (int i = 0; i < arr.length; i++) {
+            if (arr[i] > max){
+                max = arr[i];
+                maxindex = i;
+            }
+
+            if (arr[i] < min){
+                min = arr[i];
+                minindex = i;
+            }
+        }
+
+        System.out.println("最大值:"+max+"-索引:"+maxindex);
+        System.out.println("最小值:"+min+"-索引:"+minindex);
+
+        arr[minindex] = 0;
+        arr[maxindex] = 0;
+
+        double sum = 0;
+        //遍历求和 / 10-2;
+        for (int i = 0; i < arr.length; i++) {
+            sum+=arr[i];
+        }
+
+        System.out.println("平局分:"+(sum/8));
+
+    }
+
+    /*
+    **举例7(难):**输入一个整形数组,数组里有正数也有负数。数组中连续的一个或多个整数组成一个子数组,每个子数组都有一个和。
+    * 求所有子数组的和的最大值。要求时间复杂度为O(n)。
+    例如:输入的数组为1, -2, 3, 10, -4, 7, 2, -5,和最大的子数组为3, 10, -4, 7, 2,因此输出为该子数组的和18。
+     */
+    @Test
+    public void test08(){
+        int[] arr = {1, -200, 3, 10, -4, 7, 2, -5};
+        //总和
+        int childArrSum = 0;
+        //临时
+        int temp = childArrSum;
+
+        for (int i = 0; i < arr.length; i++) {
+            //和
+            temp += arr[i];
+
+            //判断
+            if ( temp > childArrSum ){
+                childArrSum = temp;
+            }
+
+            if (temp < 0){
+                temp = 0 ;
+            }
+
+            if (childArrSum == 0){
+                for (int i1 = 0; i1 < arr.length; i1++) {
+                    if ( arr[i] > childArrSum ){
+                        childArrSum = arr[i];
+                    }
+                }
+            }
+        }
+
+        System.out.println("最大子数组的和:"+childArrSum);
+
+    }
+
+
+    //**举例6:**找最值及其所有最值的下标
+    @Test
+    public void test07(){
+        int[] arr = {1,2,4,10,23,20,23,23,23};
+        //假设值
+        int max = arr[0];
+        String index = "";
+
+        for (int i = 0; i < arr.length; i++) {
+            if (arr[i] > max){
+                max = arr[i];
+                index = i+",";
+            }else if (arr[i] == max){
+                index+= i +",";
+            }
+        }
+
+        System.out.println("最大值:"+max);
+        System.out.println("索引:"+index);
+    }
+
+
+    //**举例5:**找最值及其第一次出现的下标
+    @Test
+    public void test06(){
+        int[] arr = {1,2,4,10,12,20,23,23,23};
+        //假设值
+        int max = arr[0];
+        int index = 0;
+
+        for (int i = 0; i < arr.length; i++) {
+            if (arr[i] > max){
+                max = arr[i];
+
+                index = i;
+            }
+        }
+
+        System.out.println("最大值:"+max);
+        System.out.println("索引:"+index);
+    }
+
+    //**举例4:**求数组元素的最大值
+    @Test
+    public void test05(){
+        int[] arr = {1,2,4,10,12,20,23};
+
+        //假设值
+        int max = arr[0];
+
+        for (int i = 0; i < arr.length; i++) {
+            if (arr[i] > max){
+                max = arr[i];
+            }
+        }
+
+        System.out.println("最大值:"+max);
+
+    }
+    //**举例3:**求数组元素中偶数的个数
+    @Test
+    public void test04(){
+        //数组统计:总乘鸡
+        int[] arr = {1,2,4,10,12,20,23};
+
+        int count = 0;
+        //遍历
+        for (int i = 0; i < arr.length; i++) {
+            if (arr[i] % 2 == 0){
+                count++;
+            }
+        }
+
+        System.out.println("个数:"+count);
+    }
+
+    @Test
+    public void test03(){
+        //数组统计:总乘鸡
+        int[] arr = {1,2,4,10,-12,-20,20};
+
+        int sum = 1;
+
+        for (int i = 0; i < arr.length; i++) {
+            sum *= arr[i];
+        }
+
+        System.out.println("乘积:"+sum);
+
+    }
+
+
+    @Test
+    public void test02(){
+        //数组统计:求总和、均值
+        int[] arr = {1,2,4,10,-12,-20,20};
+
+        int sum  = 0;
+        //遍历
+        for (int i = 0; i < arr.length; i++) {
+            sum+=arr[i];
+        }
+        //0.0+sum double
+        System.out.println("求平均值:"+((0.0+sum)/arr.length));
+
+    }
+
+    @Test
+    public void test01(){
+        //数组统计:求总和、均值
+        int[] arr = {1,2,4,10,-12,-20,20};
+
+        int sum  = 0;
+        //遍历
+        for (int i = 0; i < arr.length; i++) {
+            sum+=arr[i];
+        }
+        System.out.println(sum);
+
+    }
+
+
+}

+ 135 - 0
01-JavaSe/day07/src/com/lovecoding/day07/Test01Arr02.java

@@ -0,0 +1,135 @@
+package com.lovecoding.day07;
+
+import org.junit.Test;
+
+import java.lang.reflect.Array;
+import java.util.Arrays;
+import java.util.Scanner;
+
+/**
+ * ClassName: Test01Arr01
+ * Package: com.lovecoding.day07
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/5/28 9:25
+ * @Version 1.0
+ */
+public class Test01Arr02 {
+
+    //**举例6:**回形数
+    /*
+    输入数字4, 则程序输出:
+    1    2    3    4
+    12   13   14   5
+    11   16   15   6
+    10   9    8    7
+     */
+    public static void main(String[] args) {
+        test04();
+    }
+
+    public static void test04(){
+        Scanner scanner = new Scanner(System.in);
+
+        int len = scanner.nextInt();
+
+        int[][] arr = new int[len][len];
+
+        int k = 1;
+
+        int i = 0, j = 0;
+
+        for (int m = 1; m <= len*len; m++) {
+            if (k == 1){
+                if ( j < len  &&  arr[i][j] == 0){
+                    arr[i][j++] = m;
+                }else{
+                    k = 2;
+                    m--;
+                    j--;
+                    i++;
+                }
+            }else if (k == 2){
+                if ( i < len  &&  arr[i][j] == 0){
+                    arr[i++][j] = m;
+                }else{
+                    k = 3;
+                    m--;
+                    j--;
+                    i--;
+                }
+            }else if (k == 3){
+                if ( j >= 0  &&  arr[i][j] == 0){
+                    arr[i][j--] = m;
+                }else{
+                    k = 4;
+                    m--;
+                    j++;
+                    i--;
+                }
+            }else{
+                if ( i >=0  &&  arr[i][j] == 0){
+                    arr[i--][j] = m;
+                }else{
+                    k = 1;
+                    m--;
+                    j++;
+                    i++;
+                }
+            }
+        }
+
+        for (int i1 = 0; i1 < arr.length; i1++) {
+            for (int i2 = 0; i2 < arr[i1].length; i2++) {
+                System.out.print(" " + arr[i1][i2]);
+            }
+            System.out.println();
+        }
+    }
+
+    /*
+     **举例4:**创建一个长度为6的int型数组,、
+     * 要求数组元素的值都在1-30之间,且是随机赋值。同时,要求元素的值各不相同。
+     */
+    @Test
+    public void test02(){
+        int[] arr = new int[6];
+
+        //int [3,2,4,7,3
+        for (int i = 0; i < arr.length; i++) {
+            //赋值
+            arr[i] = ((int)(Math.random()*10) +1);
+
+            //判断 值 在数组已经存在
+            for (int j = 0; j < i; j++) {
+                if (arr[j] == arr[i]){
+                    //重新 执行循环
+                    i--;
+                    //优化
+                    break;
+                }
+            }
+        }
+
+        System.out.println(Arrays.toString(arr));
+    }
+   /*
+   Test01Arr01
+   **举例3:**一个数组,让数组的每个元素去除第一个元素,得到的商作为被除数所在位置的新值。
+    */
+    @Test
+    public void test01(){
+
+        int[] arr = {2,2,4,10,12,20,20};
+
+        //后 前
+        for (int i = arr.length-1; i >= 0; i--) {
+            arr[i] = arr[i]/arr[0];
+        }
+
+        System.out.println(Arrays.toString(arr));
+    }
+
+
+}

+ 46 - 0
01-JavaSe/day07/src/com/lovecoding/day07/Test01Arr03.java

@@ -0,0 +1,46 @@
+package com.lovecoding.day07;
+
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Scanner;
+
+/**
+ * ClassName: Test01Arr01
+ * Package: com.lovecoding.day07
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/5/28 9:25
+ * @Version 1.0
+ */
+public class Test01Arr03 {
+
+    //数组反转
+    @Test
+    public void test01(){
+        //之前
+        int[] arr = {2,2,4,10,12,22,20};
+
+        //次数 长度/2
+        // i= 0 长度-1-i
+        //          {20,22,12,10,4,2,2};
+
+        for (int i = 0; i < arr.length/2; i++) {
+            int temp = arr[i];
+            arr[i] = arr[arr.length-1-i];
+            arr[arr.length-1-i] = temp;
+        }
+
+        System.out.println(Arrays.toString(arr));
+
+
+        for (int left = 0 , right = arr.length-1; left < arr.length/2; left++ ,right-- ) {
+            int temp = arr[left];
+            arr[left] = arr[right];
+            arr[right] = temp;
+        }
+        System.out.println(Arrays.toString(arr));
+    }
+
+}

+ 63 - 0
01-JavaSe/day07/src/com/lovecoding/day07/Test01Arr04.java

@@ -0,0 +1,63 @@
+package com.lovecoding.day07;
+
+import org.junit.Test;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: Test01Arr01
+ * Package: com.lovecoding.day07
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/5/28 9:25
+ * @Version 1.0
+ */
+public class Test01Arr04 {
+
+    //数组缩容
+    @Test
+    public void test02(){
+        int[] arr = {1,2,3,4,5,6};
+        //删除索引为 3 的元素
+        int index = 3;
+        // {1,2,3,5,6};
+
+        int[] newArr = new int[arr.length-1];
+
+        //赋值元素
+        for (int i = 0; i < newArr.length; i++) {
+            if ( i < index){
+                newArr[i] = arr[i];
+            }else{
+                newArr[i] = arr[i+1];
+            }
+        }
+
+        System.out.println("长度:"+newArr.length);
+        System.out.println("元素:"+Arrays.toString(newArr));
+
+    }
+
+    //数组扩容
+    @Test
+    public void test01(){
+        int[] arr = {1,2,3,4,5,6};
+
+        //从新创建数组
+        System.out.println(arr.length);
+
+        //扩展
+        int[] newArr = new int[arr.length<<1];
+
+        //复制元素
+        for (int i = 0; i < arr.length; i++) {
+            newArr[i] = arr[i];
+        }
+
+        System.out.println("新数组长度:"+newArr.length);
+        System.out.println("元素:"+Arrays.toString(newArr));
+
+    }
+
+}

+ 70 - 0
01-JavaSe/day07/src/com/lovecoding/day07/Test01Arr05.java

@@ -0,0 +1,70 @@
+package com.lovecoding.day07;
+
+import org.junit.Test;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: Test01Arr01
+ * Package: com.lovecoding.day07
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/5/28 9:25
+ * @Version 1.0
+ */
+public class Test01Arr05 {
+    //数组查找
+    @Test
+    public void test02(){
+        int[] arr = {-99,-54,-2,0,2,33,43,256,999,1000};
+
+        int number = 1000;
+
+        int left = 0;
+        int right = arr.length - 1;
+
+        while ( left <=right){
+
+            //中间值
+            int mid = (left + right)/2;
+            //比较
+            if (number > arr[mid]){
+                //改变左边的值
+                left = mid+1;
+            }
+
+            if (number < arr[mid]){
+                //改变右边的值
+                right = mid-1;
+            }
+            //相等输出索引
+            if (number == arr[mid]){
+                System.out.println("位置:"+mid);
+                break;
+            }
+        }
+    }
+
+    //数组查找
+    @Test
+    public void test01(){
+        int[] arr = {1,2,3,4,5,6,7,7};
+
+        int num = 8 ;
+        int index = -1;
+
+        //比较
+        for (int i = 0; i < arr.length; i++) {
+            if (arr[i] == num){
+                index = i;
+                break;
+            }
+        }
+
+        System.out.println("索引:"+index);
+        
+
+    }
+
+}

+ 66 - 0
01-JavaSe/day07/src/com/lovecoding/day07/Test01Arr06.java

@@ -0,0 +1,66 @@
+package com.lovecoding.day07;
+
+import org.junit.Test;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: Test01Arr01
+ * Package: com.lovecoding.day07
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/5/28 9:25
+ * @Version 1.0
+ */
+public class Test01Arr06 {
+
+    //冒泡排序 优化
+    @Test
+    public void test02(){
+        int[] arr = {11,22,33,45,50,61};
+        //外部循环 循环 len - 1
+        for (int i = 0; i < arr.length-1; i++) {
+            //内循环 len - 1 - i
+            //标识
+            boolean flag = true;
+            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;
+                    //有比较交换 没有拍好序
+                    flag=false;
+                }
+            }
+            //没有比较 拍好序
+            if (flag){
+                break;
+            }
+        }
+        System.out.println(Arrays.toString(arr));
+    }
+
+    //冒泡排序
+    @Test
+    public void test01(){
+        int[] arr = {11,22,33,45,50,61,71,7};
+        //外部循环 循环 len - 1
+        for (int i = 0; i < arr.length-1; i++) {
+            //内循环 len - 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;
+                }
+            }
+        }
+        System.out.println(Arrays.toString(arr));
+    }
+
+}

+ 77 - 0
01-JavaSe/day07/src/com/lovecoding/day07/Test01Arr07.java

@@ -0,0 +1,77 @@
+package com.lovecoding.day07;
+
+import org.junit.Test;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: Test01Arr01
+ * Package: com.lovecoding.day07
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/5/28 9:25
+ * @Version 1.0
+ */
+public class Test01Arr07 {
+
+
+    //ARRAYS
+    @Test
+    public void test01(){
+        //toString( int[]a)
+        int[] arr = {4,2,3,4,123,123,12,432,423,534};
+
+        //源码
+        String s = Arrays.toString(arr);
+        System.out.println(s);
+
+
+        //排序
+        //sort(int[] a)
+        Arrays.sort(arr);
+        //源码 DualPivotQuicksort
+        System.out.println(Arrays.toString(arr));
+
+        //binarySearch
+        int i = Arrays.binarySearch(arr, 500);
+        System.out.println(i);
+
+
+        //copyOf(int[] original, int newLength)
+        int[] ints = Arrays.copyOf(arr, 4);
+        //源码 System.arraycopy
+        /*
+        arraycopy(Object src,  int  srcPos,Object dest, int destPos,int length);
+            Object src 原数组     {4,2,3,4,123,123,12,432,423,534};
+            int  srcPos 原数组 开始索引  0
+
+            Object dest 目标数组
+            int destPos   目标数组 开始索引  0
+            int length  复制数组长度。  4
+         */
+        System.out.println(Arrays.toString(ints));
+
+        // copyOfRange(int[] original, int from, int to)
+
+        int[] ints1 = Arrays.copyOfRange(arr, 1, 4);
+
+        //前闭后开
+        System.out.println(Arrays.toString(ints1));
+
+        //equals(int[] a, int[] a2) :
+
+        boolean equals = Arrays.equals(ints, ints1);
+        System.out.println(equals);
+
+        //fill(int[] a, int val) :用val值填充整个a数组
+        int[] a = new int[8];
+
+        Arrays.fill(a,5);
+
+        System.out.println(Arrays.toString(a));
+
+        Arrays.fill(a, 1, 2, 7);
+    }
+
+}

+ 34 - 0
01-JavaSe/day07/src/com/lovecoding/day07/Test01Arr08.java

@@ -0,0 +1,34 @@
+package com.lovecoding.day07;
+
+import org.junit.Test;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: Test01Arr01
+ * Package: com.lovecoding.day07
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/5/28 9:25
+ * @Version 1.0
+ */
+public class Test01Arr08 {
+
+
+    //ARRAYS
+    @Test
+    public void test01(){
+        int[] arr = new int[6];
+
+        System.out.println(arr[6]);
+    }
+
+    @Test
+    public void test02(){
+        int[][] arr = new int[6][];
+
+        System.out.println(arr[0][0]);
+    }
+
+}

BIN
01-JavaSe/out/production/day07/com/lovecoding/day07/Test01Arr01.class


BIN
01-JavaSe/out/production/day07/com/lovecoding/day07/Test01Arr02.class


BIN
01-JavaSe/out/production/day07/com/lovecoding/day07/Test01Arr03.class


BIN
01-JavaSe/out/production/day07/com/lovecoding/day07/Test01Arr04.class


BIN
01-JavaSe/out/production/day07/com/lovecoding/day07/Test01Arr05.class


BIN
01-JavaSe/out/production/day07/com/lovecoding/day07/Test01Arr06.class


BIN
01-JavaSe/out/production/day07/com/lovecoding/day07/Test01Arr07.class


BIN
01-JavaSe/out/production/day07/com/lovecoding/day07/Test01Arr08.class