xerga 1 年之前
父節點
當前提交
d1e4306d97
共有 100 個文件被更改,包括 4297 次插入0 次删除
  1. 29 0
      JavaSE/.gitignore
  2. 8 0
      JavaSE/.idea/.gitignore
  3. 6 0
      JavaSE/.idea/encodings.xml
  4. 9 0
      JavaSE/.idea/libraries/java_maven_1_0_SNAPSHOT.xml
  5. 6 0
      JavaSE/.idea/misc.xml
  6. 20 0
      JavaSE/.idea/modules.xml
  7. 124 0
      JavaSE/.idea/uiDesigner.xml
  8. 6 0
      JavaSE/.idea/vcs.xml
  9. 11 0
      JavaSE/JavaSE.iml
  10. 11 0
      JavaSE/day01/day01.iml
  11. 13 0
      JavaSE/day01/src/HelloWorld.java
  12. 27 0
      JavaSE/day01/src/Test01.java
  13. 41 0
      JavaSE/day01/src/Test02.java
  14. 58 0
      JavaSE/day01/src/Test03.java
  15. 11 0
      JavaSE/day02/day02.iml
  16. 38 0
      JavaSE/day02/src/Exer01.java
  17. 114 0
      JavaSE/day02/src/Exer02.java
  18. 70 0
      JavaSE/day02/src/Test01.java
  19. 34 0
      JavaSE/day02/src/Test02.java
  20. 39 0
      JavaSE/day02/src/Test03.java
  21. 39 0
      JavaSE/day02/src/Test04.java
  22. 27 0
      JavaSE/day02/src/Test05.java
  23. 82 0
      JavaSE/day02/src/Test06.java
  24. 40 0
      JavaSE/day02/src/Test07.java
  25. 41 0
      JavaSE/day02/src/Test08.java
  26. 51 0
      JavaSE/day02/src/Test09.java
  27. 69 0
      JavaSE/day02/src/Test10.java
  28. 41 0
      JavaSE/day02/src/Test11.java
  29. 11 0
      JavaSE/day03/day03.iml
  30. 38 0
      JavaSE/day03/src/Exer01.java
  31. 31 0
      JavaSE/day03/src/Exer02.java
  32. 51 0
      JavaSE/day03/src/Exer03.java
  33. 96 0
      JavaSE/day03/src/Exer04.java
  34. 38 0
      JavaSE/day03/src/Exer05.java
  35. 46 0
      JavaSE/day03/src/Exer06.java
  36. 49 0
      JavaSE/day03/src/HomeWork.java
  37. 38 0
      JavaSE/day03/src/Test01.java
  38. 35 0
      JavaSE/day03/src/Test02.java
  39. 36 0
      JavaSE/day03/src/Test03.java
  40. 32 0
      JavaSE/day03/src/Test04.java
  41. 58 0
      JavaSE/day03/src/Test05.java
  42. 76 0
      JavaSE/day03/src/Test06.java
  43. 26 0
      JavaSE/day03/src/Test07.java
  44. 57 0
      JavaSE/day03/src/Test08.java
  45. 11 0
      JavaSE/day04/day04.iml
  46. 49 0
      JavaSE/day04/src/com/lc/day04/arr03/Test05.java
  47. 29 0
      JavaSE/day04/src/com/lc/day04/arr04/Test01.java
  48. 63 0
      JavaSE/day04/src/com/lc/day04/arr05/Test01.java
  49. 30 0
      JavaSE/day04/src/com/lc/day04/arr05/Test02.java
  50. 35 0
      JavaSE/day04/src/com/lc/day04/arr06/Test01.java
  51. 23 0
      JavaSE/day04/src/com/lc/day04/arr07/Test01.java
  52. 39 0
      JavaSE/day04/src/com/lc/day04/bc01/Test01.java
  53. 62 0
      JavaSE/day04/src/com/lc/day04/bc02/Test02.java
  54. 66 0
      JavaSE/day04/src/com/lc/day04/bc02/Test03.java
  55. 27 0
      JavaSE/day04/src/com/lc/day04/bc02/Test04.java
  56. 52 0
      JavaSE/day04/src/com/lc/day04/exer01/Test01.java
  57. 76 0
      JavaSE/day04/src/com/lc/day04/exer01/Test02.java
  58. 34 0
      JavaSE/day04/src/com/lc/day04/exer01/Test03.java
  59. 42 0
      JavaSE/day04/src/com/lc/day04/exer01/Test04.java
  60. 95 0
      JavaSE/day04/src/com/lc/day04/exer02/Test01.java
  61. 91 0
      JavaSE/day04/src/com/lc/day04/exer02/Test02.java
  62. 178 0
      JavaSE/day04/src/com/lc/day04/exer02/Test03.java
  63. 11 0
      JavaSE/day05/day05.iml
  64. 64 0
      JavaSE/day05/src/com/lc/day05/arr/TestArr01.java
  65. 59 0
      JavaSE/day05/src/com/lc/day05/arr/TestArr02.java
  66. 30 0
      JavaSE/day05/src/com/lc/day05/arr1/TestArr01.java
  67. 44 0
      JavaSE/day05/src/com/lc/day05/arr1/TestArr02.java
  68. 62 0
      JavaSE/day05/src/com/lc/day05/arr1/TestArr03.java
  69. 39 0
      JavaSE/day05/src/com/lc/day05/arr1/TestArr04.java
  70. 28 0
      JavaSE/day05/src/com/lc/day05/arr2/Test02.java
  71. 23 0
      JavaSE/day05/src/com/lc/day05/arr2/Test03.java
  72. 22 0
      JavaSE/day05/src/com/lc/day05/arr2/Test04.java
  73. 35 0
      JavaSE/day05/src/com/lc/day05/arr2/Test05.java
  74. 27 0
      JavaSE/day05/src/com/lc/day05/arr2/Test06.java
  75. 26 0
      JavaSE/day05/src/com/lc/day05/arr2/Test07.java
  76. 123 0
      JavaSE/day05/src/com/lc/day05/exer/Exer01.java
  77. 65 0
      JavaSE/day05/src/com/lc/day05/exer/Exer02.java
  78. 44 0
      JavaSE/day05/src/com/lc/day05/exer/Exer03.java
  79. 11 0
      JavaSE/day06/day06.iml
  80. 34 0
      JavaSE/day06/src/com/lc/day06/obj01/Studet.java
  81. 50 0
      JavaSE/day06/src/com/lc/day06/obj01/Test01.java
  82. 24 0
      JavaSE/day06/src/com/lc/day06/obj02/Student.java
  83. 27 0
      JavaSE/day06/src/com/lc/day06/obj02/TestStudent.java
  84. 26 0
      JavaSE/day06/src/com/lc/day06/obj02/TestStudent1.java
  85. 22 0
      JavaSE/day06/src/com/lc/day06/obj03/Husband.java
  86. 55 0
      JavaSE/day06/src/com/lc/day06/obj03/Test01.java
  87. 19 0
      JavaSE/day06/src/com/lc/day06/obj03/Wife.java
  88. 51 0
      JavaSE/day06/src/com/lc/day06/obj04/TestMethod01.java
  89. 39 0
      JavaSE/day06/src/com/lc/day06/obj04/TestMethod02.java
  90. 33 0
      JavaSE/day06/src/com/lc/day06/obj04/TestMethod03.java
  91. 42 0
      JavaSE/day06/src/com/lc/day06/obj04/TestMethod04.java
  92. 73 0
      JavaSE/day06/src/com/lc/day06/obj04/TestMethod05.java
  93. 30 0
      JavaSE/day06/src/com/lc/day06/obj04/TestMethod06.java
  94. 42 0
      JavaSE/day06/src/com/lc/day06/obj05/Person.java
  95. 30 0
      JavaSE/day06/src/com/lc/day06/obj05/Person1.java
  96. 83 0
      JavaSE/day06/src/com/lc/day06/obj05/Test01.java
  97. 26 0
      JavaSE/day06/src/com/lc/day06/obj05/TestPerson.java
  98. 11 0
      JavaSE/day07/day07.iml
  99. 40 0
      JavaSE/day07/src/com/lc/day07/constaract04/AAA.java
  100. 42 0
      JavaSE/day07/src/com/lc/day07/constaract04/Person.java

+ 29 - 0
JavaSE/.gitignore

@@ -0,0 +1,29 @@
+### IntelliJ IDEA ###
+out/
+!**/src/main/**/out/
+!**/src/test/**/out/
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+bin/
+!**/src/main/**/bin/
+!**/src/test/**/bin/
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 8 - 0
JavaSE/.idea/.gitignore

@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml

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

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
+    <file url="PROJECT" charset="UTF-8" />
+  </component>
+</project>

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

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

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>

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

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/JavaSE.iml" filepath="$PROJECT_DIR$/JavaSE.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day01/day01.iml" filepath="$PROJECT_DIR$/day01/day01.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day02/day02.iml" filepath="$PROJECT_DIR$/day02/day02.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day03/day03.iml" filepath="$PROJECT_DIR$/day03/day03.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day04/day04.iml" filepath="$PROJECT_DIR$/day04/day04.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day05/day05.iml" filepath="$PROJECT_DIR$/day05/day05.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day06/day06.iml" filepath="$PROJECT_DIR$/day06/day06.iml" />
+      <module fileurl="file://$PROJECT_DIR$/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" />
+      <module fileurl="file://$PROJECT_DIR$/day10/day10.iml" filepath="$PROJECT_DIR$/day10/day10.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day11/day11.iml" filepath="$PROJECT_DIR$/day11/day11.iml" />
+      <module fileurl="file://$PROJECT_DIR$/day12/day12.iml" filepath="$PROJECT_DIR$/day12/day12.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>

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

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

+ 13 - 0
JavaSE/day01/src/HelloWorld.java

@@ -0,0 +1,13 @@
+/**
+ * ClassName: HelloWorld
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/21 15:16
+ * @Version 1.0
+ */
+public class HelloWorld {
+    //生成主函数 psvm
+    public static void main(String[] args) {
+        //输出 sout
+        System.out.println("Hello World");
+    }
+}

+ 27 - 0
JavaSE/day01/src/Test01.java

@@ -0,0 +1,27 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/21 15:31
+ * @Version 1.0
+ */
+public class Test01 {
+    //单行
+
+    /*
+        多行
+     */
+
+    /**
+     *  文档注释 后面
+     */
+    public static void main(String[] args) {
+        //小数   整数   字符串(文本)   布尔 (true false)  字符类型  字面量
+        System.out.println(1.111111);
+        System.out.println(1000);
+        System.out.println("helloworld");
+        System.out.println(true);
+        //System.out.println('中'); //单引号 自由一个字符
+        System.out.println('A');
+    }
+}

+ 41 - 0
JavaSE/day01/src/Test02.java

@@ -0,0 +1,41 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/21 15:31
+ * @Version 1.0
+ */
+public class Test02 {
+
+    public static void main(String[] args) {
+        //整数
+        byte a = 127; // 超出报错
+
+        short b = 128;
+
+        int c  = 1234567891;
+
+        long d = 12345678910L; //数值 取int long类型需要加 L
+
+        // 小数
+        float e = 1.1234567890F; // 加F
+        double f = 1.123456789987654321; // 可以加D
+
+        // char
+        char g = 'C'; //单引号
+
+        // boolean
+        boolean h = true;
+
+        //使用变量输出
+        System.out.println(a);
+        System.out.println(b);
+        System.out.println(c);
+        System.out.println(d);
+        System.out.println(e);
+        System.out.println(f);
+        System.out.println(g);
+        System.out.println(h);
+
+    }
+}

+ 58 - 0
JavaSE/day01/src/Test03.java

@@ -0,0 +1,58 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/21 15:31
+ * @Version 1.0
+ */
+public class Test03 {
+
+    public static void main(String[] args) {
+       /*
+       变量的注意事项:
+
+        - 变量名不能重复
+        - 变量未赋值,不能使用
+        - 定义long类型变量,数据后面加L 不然默认是int类型
+        - 定义float类型变量,数据后面加F
+        */
+
+//        int a = 10;
+//        int a = 20; //重复
+//
+//        int b;
+//        System.out.println(b); //未赋值
+
+        //作用域 问题
+//        int b = 20;
+//        {
+//            int a =10;
+//            System.out.println(b);
+//        }
+//
+//        System.out.println(a);
+
+        // String // 引用数据类型
+
+        String a = "tom";
+        String b = "坤坤";
+
+        System.out.println(a);
+        System.out.println(b);
+
+
+        //变量使用
+        int a1 = 10;
+
+        a1 = 20;
+
+        //+-
+        int a2 = a1 + 20; //其他变量
+
+        a1 = a1 + 20; //赋值给自己
+
+        //直接输出
+        System.out.println(a1);
+
+    }
+}

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

+ 38 - 0
JavaSE/day02/src/Exer01.java

@@ -0,0 +1,38 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Exer01 {
+
+
+    public static void main(String[] args) {
+        /*
+        1. 定义变量a 判断是否时偶数,输出boolean值
+        2. 定义变量b是否能被7整除,输出boolean值
+        3. 将变量a进行++操作,在判断是否时偶数并且能否被7整除,输出boolean值
+        4. 输出a的值
+         */
+
+        int a =102;
+
+        boolean odd = (a % 10 == 0);
+
+        System.out.println("是否是偶数:"+odd);
+
+        System.out.println("是否是偶数"+(a % 10 == 0));
+
+        int b = 107;
+
+        System.out.println("能否被7整除:"+(b % 7 == 0));
+
+        a++;
+        System.out.println("能否被7整除:"+(a % 7 == 0));
+        System.out.println("a:"+a);
+
+
+    }
+    
+}

+ 114 - 0
JavaSE/day02/src/Exer02.java

@@ -0,0 +1,114 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Exer02 {
+
+
+    public static void main(String[] args) {
+        /*
+       定义变量 分数.
+       分数小于300 当保安。大于400上本科,  大于500 一本 大于 600 上985院校 .
+         */
+        int s = 501;
+
+        if (s >= 0 && s <= 750){
+            if (s <= 300){
+                System.out.println("当保安");
+            }else if (s >= 400 && s < 500){
+                System.out.println("上本科");
+            }else if (s >= 500 && s < 600){
+                System.out.println("一本");
+            }else if (s >= 600){
+                System.out.println("上985院校");
+            }
+        }
+
+
+
+        //分数 0 - 750
+        //嵌套
+
+
+
+
+        /*
+        定义月份变量. 月份在1-3输出春季,后面省略 ,可用嵌套保证程序的健壮性.
+         */
+
+        int m = 4;
+
+        if (m >= 1 && m <= 12){
+            if ( m ==1 || m == 2 || m == 3 ){
+                System.out.println("春天");
+            }else if ( m ==4 || m == 5 || m == 6 ){
+                System.out.println("夏天");
+            }else if ( m ==7 || m == 8 || m == 9 ){
+                System.out.println("秋天");
+            }else if ( m ==10 || m == 11 || m == 12 ){
+                System.out.println("冬天");
+            }
+        }
+
+
+        //定义三个整数变量. 按顺序输出 变量的大小.从小到大.
+        int a = 20;
+        int b = 15;
+        int c = 18;
+
+        //交换
+        if (a > b){
+            //临时变量
+            int temp = a;
+            a = b;
+            b = temp;
+        }
+
+        if (b > c){
+            //临时变量
+            int temp = b;
+            b = c;
+            c = temp;
+        }
+
+        if (a > b){
+            //临时变量
+            int temp = a;
+            a = b;
+            b = temp;
+        }
+
+        System.out.println(a +" < "+ b + " < "+ c );
+
+
+        int a1 = 10;
+        int a2 = 40;
+        int a3 = 30;
+
+        if (a1 > a2){
+            if (a2 > a3){
+                System.out.println( a1 + ">" +a2 + ">"+ a3 );
+            }else{
+                if (a1 > a3){
+                    System.out.println( a1 + ">" +a3 + ">"+ a2 );
+                }else{
+                    System.out.println( a3 + ">" +a1 + ">"+ a2 );
+                }
+            }
+        }else{
+            //a2
+            if (a1 > a3){ //
+                System.out.println( a2 + ">" +a1 + ">"+ a3 );
+            }else{ // a3
+                if ( a2 > a3 ){
+                    System.out.println( a2 + ">" +a3 + ">"+ a1 );
+                }else{
+                    System.out.println( a3 + ">" +a2 + ">"+ a1 );
+                }
+            }
+        }
+    }
+}

+ 70 - 0
JavaSE/day02/src/Test01.java

@@ -0,0 +1,70 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test01 {
+
+    /*
+         +  -  *  /  %
+     */
+    public static void main(String[] args) {
+        // +
+        int a = 10 + 20;
+
+        int b = a + 20;
+        System.out.println(b);
+
+        // *
+        double d = 0.1 * 0.3;
+
+        System.out.println(d);
+        // / 整除
+        int i = 10 / 3;
+        System.out.println(i);
+
+        // % 模
+        int i1 = 10 % 3;
+        int i2 = -10 % 3;
+        int i3 = 10 % -3;
+        System.out.println(i1);
+        System.out.println(i2);
+        System.out.println(i3);
+
+        int a1 = 153;
+
+        int g = a1 % 10;
+        int s = a1 / 10 % 10;
+        int b1 = a1 / 100;
+
+        System.out.println("个:"+g);
+        System.out.println("十:"+s);
+        System.out.println("百:"+b1);
+
+
+        //练习
+        /*
+        马晕一天能赚5个亿左右,就是5个小目标,假如普通人一天可以赚120元,
+        一个月赚4200元,那么想赚够马晕一天的收益,需要多少个月零几天?
+
+        先算出 月份  再算天数
+        分析:
+        月份 = 5个亿  /  4200;
+        天数 =   5个亿  %  4200  / 120;
+         */
+
+        int c = 500000000;
+        int m = 4200;
+        int day = 120;
+
+        //月份
+        System.out.println( "月"+ (c / m));
+        //天数
+        System.out.println( "天"+ (c % m / day));
+    }
+
+
+
+}

+ 34 - 0
JavaSE/day02/src/Test02.java

@@ -0,0 +1,34 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test02 {
+
+    /*
+        + 号特殊用法
+     */
+    public static void main(String[] args) {
+        byte a1 = 10;
+        byte a2 = 10;
+
+        //byte a3 = a1 + a2;  // ( 编译 )
+
+        //byte a4 = a1 + 10;  // ( 编译 )
+
+        //byte a5 = 10 + 10;    //  不报错
+
+        // + 可以连接字符窜
+        System.out.println(a1+"2"); // 连接
+        //整数 a1+1 相同类型 先做 + 法 之后做连接
+        System.out.println(a1+1+"2"+a2); // 11210
+        //两两 运算 前后顺序
+        System.out.println(a1+1+"2"+a2+10); // 1121010
+
+    }
+
+
+
+}

+ 39 - 0
JavaSE/day02/src/Test03.java

@@ -0,0 +1,39 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test03 {
+
+    /*
+        + 号特殊用法
+            ++ 自增 : 自身 + 1
+                前++ :单独形成一行,没有任何影响
+                     : 参与运算 : 前++ 先自身加1. 再运算
+                后++ :单独形成一行,没有任何影响
+                     : 参与运算 : 先获取值 进行运算, 运算之后在+1
+        - 号
+            -- 自减 : 自身 -1
+     */
+    public static void main(String[] args) {
+        int a1 = 10;
+        //a1++;
+        ++a1;
+        System.out.println(a1);
+
+        int a2 = 20;
+
+        //int a3 = a2++ +10;  // 30 在取20的值 做运算 20 + 10 = 30
+        int a4 = ++a2 +10;    // 31 先加1  a2 = 21 在和 10 相加 = 31
+
+        //System.out.println(a3);
+        System.out.println(a4);
+
+        System.out.println(a2);
+    }
+
+
+
+}

+ 39 - 0
JavaSE/day02/src/Test04.java

@@ -0,0 +1,39 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test04 {
+
+
+    public static void main(String[] args) {
+        //String str1 = 4;                       //判断对错:
+        String str2 = 3.5F + "";               //判断str2对错:
+        System.out.println(str2);              //输出:
+        System.out .println(3+4+"Hello!");     //输出:
+        System.out.println("Hello!"+3+4);      //输出:
+        System.out.println('a'+1+"Hello!");    //输出:数据类型转换
+        System.out.println("Hello"+'a'+1);     //输出:
+
+        //分析
+//        int i = 1;  // 2  3  4
+//        //      1   +   3 * 3
+//        int k = i++ + ++i * i++;
+//        System.out.println("k = " + k); //? 10
+//        System.out.println("i = " + i); //? 4
+
+
+        int i = 2;
+        int j = i++;
+        System.out.println(j); // 2
+        System.out.println(i); // 3
+
+        int m = 2;
+        m = m++;   //
+        //(1)先取m的值“2”放操作数栈 (2)m再自增,m=3 (3)再把操作数栈中的"2"赋值给m,m=2
+        System.out.println(m);
+    }
+
+}

+ 27 - 0
JavaSE/day02/src/Test05.java

@@ -0,0 +1,27 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test05 {
+
+
+    public static void main(String[] args) {
+        // +=
+
+        int a = 10;
+
+        a+=20; // a = a + 20;
+
+        System.out.println(a);
+
+        int b = 10;
+
+        b %= 3; // b = b % 3;
+
+        System.out.println(b);
+    }
+    
+}

+ 82 - 0
JavaSE/day02/src/Test06.java

@@ -0,0 +1,82 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test06 {
+
+
+    public static void main(String[] args) {
+        // 自动转换
+        byte a1 = 10;
+
+        //int 接收
+        int a2 = a1;
+
+        // + a1 byte 10 int
+        /*
+                                              0000 1010
+                0000 0000 0000 0000 0000 0000 0000 1010
+         */
+        int a3 = a1 + 10;
+
+        // byte short char 都转成int
+        byte a4 = 10;
+        byte a5 = 10;
+        short a6 = 10;
+        char a7 = 'a'; //a7 码表
+
+        //short i = a4 + a5;
+        int a8 = a7 + 1; // a = 码表 值 a = 97  98
+        System.out.println(a8);
+
+        int a10 = 120 ;
+        double a11 = a10;
+
+
+        //强制转换 : 损失精度。
+        int i1 = 128;
+
+        byte i2 = (byte) i1;
+        System.out.println(i2); //-128
+        // 底层存储
+        // 0000 0000 1000 0000  int
+        // 1000 0000 byte 1000 0000 = -128
+
+        int i3 = 12345;
+        byte i4 = (byte) i3;
+        System.out.println(i4); // 57
+
+        // 0011 0000 0011 1001
+        //           0011 1001
+
+
+        /*
+            short s = 10
+            s = s + 2;和  s += 2  区别
+
+         */
+
+        short s = 10;
+        //s = s + 2; // 编译不通过  2 常量 常量默认是 int  结果 是 int
+
+        s += 2; // 编译通过  2 常量  += 运算符 本质是强制转换
+        //s = (short) (s+2);
+
+        int b1 = 10;
+        double b2 = b1;
+
+        double b3 = 10;
+        System.out.println(b2);
+        System.out.println(b3);
+
+        char c = 'a'; // 本质 是 97 代表 a
+
+        byte b4 = 100; //常量优化
+        // byte b5 = 128; //常量优化
+
+    }
+    
+}

+ 40 - 0
JavaSE/day02/src/Test07.java

@@ -0,0 +1,40 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test07 {
+
+
+    public static void main(String[] args) {
+
+        //int
+        int a1 = 10;
+        int a2 = 20;
+        boolean b1 = (a1 == a2);
+        System.out.println(b1);
+
+        System.out.println(4 != 3);
+
+        int i1 = 10;
+        int i2 = 20;
+        System.out.println(i1 == i2);//false
+        System.out.println(i1 != i2);//true
+        System.out.println(i1 >= i2);//false
+
+
+        int m = 10;
+        int n = 20;
+        System.out.println(m == n);//false
+        System.out.println(m = n);//20 // 赋值
+
+        boolean b3 = false;
+        boolean b2 = true;
+        System.out.println(b1 == b2);//false
+        System.out.println(b1 = b2);//true
+
+    }
+    
+}

+ 41 - 0
JavaSE/day02/src/Test08.java

@@ -0,0 +1,41 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test08 {
+
+
+    public static void main(String[] args) {
+
+        System.out.println(3==3 & 3!=4); //T & T T
+
+        int i=1;
+//        System.out.println(1 == 1 & i++ == 2 ); // F
+//        System.out.println(i); // 2
+//        System.out.println(2 == 1 & i++ == 2 ); // F
+//        System.out.println(i ); // i++ 运行
+
+        //&& 短路
+//        System.out.println(2 == 1 && i++ == 2 ); // 前面2 == 1返回 F 后面不执行
+//        System.out.println(i ); // i++ 不运行
+
+        // ||
+//        System.out.println(1 == 1 || i++ == 2 ); // 前面1 == 1返回 T 后面不执行
+//        System.out.println(i ); // i++ 不运行
+
+        System.out.println(1 == 1 | i++ == 2 ); // 前面1 == 1返回 T 后面执行
+        System.out.println(i ); // i++ 运行
+
+        //用  双 && 双 ||
+
+        System.out.println(1==1 ^ 1==2);
+        System.out.println(1==1 ^ 2==2);
+
+
+
+    }
+    
+}

+ 51 - 0
JavaSE/day02/src/Test09.java

@@ -0,0 +1,51 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test09 {
+
+
+    public static void main(String[] args) {
+
+        //状态
+        boolean isRed = true;
+
+        //判断 是红  返回停止  不是 返回通行
+        String result = ( isRed  ) ? "停止" : "通行";
+
+
+        System.out.println(result);
+        //注意: 值1 和 值2 必须兼容。
+        //      三元运算符 必须有结果赋值。
+
+        //比较两个数的大小 返回大的数字
+        int a1 = 20;
+        byte a2 = 30;
+
+        int a3 = ( a1 > a2 ) ? a1 : a2;
+
+        System.out.println(a3);
+
+
+        //获取三个数中的最大值
+        int i1 = 40;
+        int i2 = 20;
+        int i3 = 30;
+
+        //两个两个比较
+        int max = i1 > i2 ? i1 : i2;
+
+        // 比较 i3
+        max = max > i3 ? max : i3;
+
+        System.out.println(max);
+
+        //不推荐
+        int i = (i1 > i2 ? i1 : i2) > i3 ? (i1 > i2 ? i1 : i2) : i3;
+        System.out.println(i);
+    }
+    
+}

+ 69 - 0
JavaSE/day02/src/Test10.java

@@ -0,0 +1,69 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test10 {
+
+    /*
+        if语句
+
+        2023.8.24是小日本子核废水排污的日子,这一天终将被历史铭记.
+        需求:定义时间20230824 如果等于此刻 投放核弹 炸死小日本.
+
+        String
+        int
+
+
+        小日本最终的结局只有两个,被核弹消灭,被海洋淹没.但是需要形成一定的条件.
+        如果有战争小日本被核弹消灭,没有被海洋淹没.
+        需求:定义定义变量 war 如果是true 用核弹消灭小日本,否则被海水淹没.
+
+
+        小明公司出品干死小日本游戏,在游戏中对于杀死小日本人数,给出响应奖励.
+
+        - 杀死  10人以内, 奖励人民币100元.
+        - 杀死  10 - 100 人以内, 奖励华为手机一部.
+        - 杀死  100 - 1000 人以内, 奖励奇瑞汽车一台.
+        - 杀死  1000 - 10000 人以内, 奖励保时捷.
+
+     */
+    public static void main(String[] args) {
+        int date = 20230825;
+
+        if (date == 20230824){
+            System.out.println("投放核弹 炸死小日本");
+        }
+
+        //if else
+
+        boolean war = false;
+
+        if (war){
+            System.out.println("用核弹消灭小日本");
+        }else{
+            System.out.println("被海水淹没");
+        }
+
+        //if else if ... else
+        System.out.println("-----------------");
+
+        int persons = -1;
+
+        if ( persons > 0 && persons <=10 ){
+            System.out.println("奖励人民币100元.");
+        }else if (persons > 10 && persons <=100){
+            System.out.println("奖励华为手机一部.");
+        }else if (persons > 100 && persons <=1000){
+            System.out.println("汽车.");
+        }else if (persons > 1000 && persons <=10000){
+            System.out.println("奖励保时捷.");
+        }else{
+            System.out.println("没有对应的奖励");
+        }
+
+    }
+    
+}

+ 41 - 0
JavaSE/day02/src/Test11.java

@@ -0,0 +1,41 @@
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/10/28 9:27
+ * @Version 1.0
+ */
+public class Test11 {
+
+    public static void main(String[] args) {
+
+        if (false)
+            System.out.println("123");
+        // 将 if后面下一条执行语句 为执行体
+        // 省略必须有缩进
+        System.out.println("456");
+
+
+        if(true){};
+        //; 结尾
+        System.out.println("111");
+
+
+        int a1 = 10;
+        int a2 = 20;
+
+        int max;
+        if (a1> a2){
+            max = a1;
+            System.out.println("a1>a2");
+        }else{
+            max = a2;
+            System.out.println("a2>a1");
+        }
+
+        max = ( a1 > a2) ? a1 : a2;
+
+
+    }
+    
+}

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

+ 38 - 0
JavaSE/day03/src/Exer01.java

@@ -0,0 +1,38 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: Exer01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 10:19
+ * @Version 1.0
+ */
+/*
+大家都知道,如果想成为一名ikun,当然要提出一定的条件:是否中分:是; 背带裤:是; 篮球:是。
+
+如果这三个条件同时满足,则:“真爱粉”
+如果三个条件有为真的情况,则:“假ikun”
+如果三个条件都不满足,则:“小黑子!”
+ */
+public class Exer01 {
+    public static void main(String[] args) {
+        Scanner scanner = new Scanner(System.in);
+        System.out.println("是否中分(1/0)");
+        int i = scanner.nextInt();
+
+        System.out.println("背带裤:(true/flase)");
+        boolean b = scanner.nextBoolean();
+
+        System.out.println("背带裤:是/否 ");
+        String s = scanner.next();
+
+        if ( i == 1 && b && s.equals("是") ){
+            System.out.println("真爱粉");
+        }else if (i == 1 || b || s.equals("是")){
+            System.out.println("假ikun");
+        }else if (i != 1 && !b && !s.equals("是")){
+            System.out.println("小黑子!");
+        }
+        
+    }
+}

+ 31 - 0
JavaSE/day03/src/Exer02.java

@@ -0,0 +1,31 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: Exer01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 10:19
+ * @Version 1.0
+ */
+/*
+输入学生年龄,如果大于18岁的,输出“成年人”。低于18岁的,输出“青少年”。
+ */
+public class Exer02 {
+    public static void main(String[] args) {
+
+        Scanner scanner = new Scanner(System.in);
+        System.out.println("请输入年龄");
+        int age = scanner.nextInt();
+
+        switch (age/18){
+            case 0:
+                System.out.println("青少年");
+                break;
+            case 1,2,3,4: //新语法
+                System.out.println("成年人");
+                break;
+
+        }
+
+    }
+}

+ 51 - 0
JavaSE/day03/src/Exer03.java

@@ -0,0 +1,51 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: Exer01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 10:19
+ * @Version 1.0
+ */
+/*
+从键盘上输入2023年的“month”和“day”,要求通过程序输出输入的日期为2023年的第几天。
+ */
+public class Exer03 {
+    public static void main(String[] args) {
+
+
+        int month = 2;
+        int day = 28;
+
+        int days = 0;
+
+        switch (month){
+            case 12:
+                days += 30;
+            case 11:
+                days += 31;
+            case 10:
+                days += 30;
+            case 9:
+                days += 31;
+            case 8:
+                days += 31;
+            case 7:
+                days += 30;
+            case 6:
+                days += 31;
+            case 5:
+                days += 30;
+            case 4:
+                days += 31;
+            case 3:
+                days += 28;
+            case 2:
+                days += 31;
+            case 1:
+                days+=day;
+
+        }
+        System.out.println(days);
+    }
+}

+ 96 - 0
JavaSE/day03/src/Exer04.java

@@ -0,0 +1,96 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: HomeWork
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 9:19
+ * @Version 1.0
+ */
+public class Exer04 {
+    /*
+    定义 年、月、日,要求年份必须是正整数,月份范围是[1,12],
+    日期也必须在本月总天数范围内,如果输入正确,输出“年-月-日”结果,否则提示输入错误。
+
+    从键盘上输入 year年的“month”和“day”,要求通过程序输出输入的日期为year年的第几天。 闰年
+
+     */
+    public static void main(String[] args) {
+
+        //键盘输入
+        Scanner scanner = new Scanner(System.in);
+        System.out.println("请入年份");
+        int year = scanner.nextInt();
+        System.out.println("请入月份");
+        int m = scanner.nextInt();
+        System.out.println("请入天数");
+        int day = scanner.nextInt();
+
+        int sum = 0;
+
+        if ( year > 0 ){
+            //月份范围是[1,12]
+            if ( m >= 1 && m <=12 ){
+                //日期也必须在本月总天数范围内
+                int days;
+                if (m == 1 || m==3 || m==5 || m==7 || m==8 || m==10 || m==12){
+                    days=31;
+                }else if ( m == 2 ){
+                    //闰年 判断
+                    if (year % 4== 0 && year%100 != 0 || year % 400 == 0){
+                        days= 29;
+                    }else {
+                        days =28;
+                    }
+                }else{
+                    // 4 6 9 11月
+                    days = 30;
+                }
+                //判断
+                if ( day >= 1 && day <= days){
+
+                    System.out.println(year+"年-"+m+"月-"+days+"日");
+
+                    switch (m){
+                        case 12:
+                            sum += 30;
+                        case 11:
+                            sum += 31;
+                        case 10:
+                            sum += 30;
+                        case 9:
+                            sum += 31;
+                        case 8:
+                            sum += 31;
+                        case 7:
+                            sum += 30;
+                        case 6:
+                            sum += 31;
+                        case 5:
+                            sum += 30;
+                        case 4:
+                            sum += 31;
+                        case 3:
+                            if ( year % 4== 0 && year%100 != 0 || year % 400 == 0  ){
+                                sum++;
+                            }
+                            sum += 28;
+                        case 2:
+                            sum += 31;
+                        case 1:
+                            sum+=day;
+
+                    }
+                    System.out.println(year+"年-"+m+"月-"+day+"日是第"+sum+"天");
+
+                }else{
+                    System.out.println("日期也必须在本月总天数范围内");
+                }
+            }else{
+                System.out.println("月份范围是[1,12]");
+            }
+        }else {
+            System.out.println("年份必须是正整数");
+        }
+    }
+}

+ 38 - 0
JavaSE/day03/src/Exer05.java

@@ -0,0 +1,38 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: HomeWork
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 9:19
+ * @Version 1.0
+ */
+public class Exer05 {
+    public static void main(String[] args) {
+        //判断1-100之间,有多少个7.
+
+        int count = 0;
+        for (int i = 1; i < 100; i++) {
+            if ( i % 10 == 7 ){
+                count++;
+            }
+            if ( i / 10 == 7 ){
+                count++;
+            }
+        }
+        System.out.println(count);
+
+
+        //输出一个三位数的水仙花数字.
+        for (int i = 100; i < 999 ; i++) {
+            //个位十位百位
+            int g = i % 10;
+            int s = i / 10 % 10;
+            int b = i / 100;
+
+            if (i == g*g*g + s*s*s + b*b*b){
+                System.out.println(i);
+            }
+        }
+    }
+}

+ 46 - 0
JavaSE/day03/src/Exer06.java

@@ -0,0 +1,46 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: Exer06
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 16:12
+ * @Version 1.0
+ */
+public class Exer06 {
+
+    /*
+    练习:键盘输入一个数字.判断其是否是 素数( 素数只能被1-本身整除的数字 )
+    判断其是否是 素数
+
+    举例 7   13   17  19
+     7
+        2 3 4 5 6
+     */
+    public static void main(String[] args) {
+        Scanner scanner = new Scanner(System.in);
+
+        int num = scanner.nextInt();
+        //判断标识
+        boolean flag = true;
+
+        for (int i = 2; i < num; i++) {
+            //判断每一个 i
+            if ( num % i == 0){
+                //有一个i 可以被模开 不是素数 改变标识
+                flag = false;
+            }
+        }
+
+        //标识判断
+        if (flag){
+            System.out.println(num+"是一个素数");
+        }else {
+            System.out.println(num+"不是一个素数");
+        }
+
+
+    }
+
+
+}

+ 49 - 0
JavaSE/day03/src/HomeWork.java

@@ -0,0 +1,49 @@
+/**
+ * ClassName: HomeWork
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 9:19
+ * @Version 1.0
+ */
+public class HomeWork {
+    /*
+    定义 年、月、日,要求年份必须是正整数,月份范围是[1,12],
+    日期也必须在本月总天数范围内,如果输入正确,输出“年-月-日”结果,否则提示输入错误。
+     */
+    public static void main(String[] args) {
+        int year = 2001;
+        int m = 2;
+        int day = 29;
+
+        if ( year > 0 ){
+            //月份范围是[1,12]
+            if ( m >= 1 && m <=12 ){
+                //日期也必须在本月总天数范围内
+                int days;
+                if (m == 1 || m==3 || m==5 || m==7 || m==8 || m==10 || m==12){
+                    days=31;
+                }else if ( m == 2 ){
+                    //闰年 判断
+                    if (year % 4== 0 && year%100 != 0 || year % 400 == 0){
+                        days= 29;
+                    }else {
+                        days =28;
+                    }
+                }else{
+                    // 4  6 9 11月
+                    days = 30;
+                }
+                //判断
+                if ( day >= 1 && day <= days){
+                    System.out.println(year+"年-"+m+"月-"+days+"日");
+                }else{
+                    System.out.println("日期也必须在本月总天数范围内");
+                }
+            }else{
+                System.out.println("月份范围是[1,12]");
+            }
+        }else {
+            System.out.println("年份必须是正整数");
+        }
+    }
+}

+ 38 - 0
JavaSE/day03/src/Test01.java

@@ -0,0 +1,38 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: Test01 键盘输入
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 9:44
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) {
+        //导入
+
+        //创建对象
+        // 类型  变量   =  new 构造方法(参数);
+        Scanner scanner = new Scanner(System.in);
+
+        //调用
+        System.out.println("请输入Int类型");
+        int i = scanner.nextInt();
+        //结果赋值给 i
+
+        System.out.println("输入的值:"+i);
+
+
+        System.out.println("请输入Double类型");
+        double d = scanner.nextDouble();
+        //结果赋值给 i
+
+        System.out.println("输入的值:"+ d);
+
+        System.out.println("请输入Boolean类型");
+        boolean b = scanner.nextBoolean();
+        System.out.println("输入的值:"+b);
+
+    }
+}

+ 35 - 0
JavaSE/day03/src/Test02.java

@@ -0,0 +1,35 @@
+/**
+ * ClassName: Test02
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 10:40
+ * @Version 1.0
+ */
+public class Test02 {
+    public static void main(String[] args) {
+        //随机数
+        double random = Math.random();
+        //0-1 小数数字
+        System.out.println(random);
+
+        //0 - 100
+        double v = random * 100;
+        System.out.println(v);
+
+        //转换
+        int i = (int) v;
+
+        System.out.println(i);
+
+        // 50 - 100
+
+        // 0-50  + 50 ;
+        int i1 = (int) (Math.random() * 50) + 50; // 0-49
+        System.out.println(i1);
+
+        // a - b;
+        // (int) (Math.random() * a - b) + a
+
+
+    }
+}

+ 36 - 0
JavaSE/day03/src/Test03.java

@@ -0,0 +1,36 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: Switch语句
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 10:40
+ * @Version 1.0
+ */
+public class Test03 {
+    public static void main(String[] args) {
+
+        Scanner scanner = new Scanner(System.in);
+        System.out.println("请输入季节");
+        String next = scanner.next();
+
+        //switch
+        switch (next){
+            case "春":
+                System.out.println("春天,万物复苏");
+                break; //break 在switch 作用结束 switch语句
+            case "夏":
+                System.out.println("夏天,热热热热");
+                break;
+            case "秋":
+                System.out.println("夏天,丰收");
+                break;
+            case "冬天":
+                System.out.println("夏天,寒冷");
+                break;
+            default:
+                System.out.println("没这个季节");
+                //break;
+        }
+    }
+}

+ 32 - 0
JavaSE/day03/src/Test04.java

@@ -0,0 +1,32 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: Switch语句 特点
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 10:40
+ * @Version 1.0
+ */
+public class Test04 {
+    public static void main(String[] args) {
+
+        char a = '4';
+
+        //switch
+        switch (a) {
+
+            case '1':
+                System.out.println("夏天,寒冷");
+
+            case '2':
+                System.out.println("夏天,寒冷");
+
+            case '3':
+                System.out.println("夏天,寒冷");
+
+            default:
+                System.out.println("默认");
+
+        }
+    }
+}

+ 58 - 0
JavaSE/day03/src/Test05.java

@@ -0,0 +1,58 @@
+/**
+ * ClassName: for 循环
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 10:40
+ * @Version 1.0
+ *
+ *
+ *
+ */
+public class Test05 {
+    public static void main(String[] args) {
+
+        //循环 加上 号码
+        for (
+                int i = 0 ;
+                i < 10 ;
+                i++ ){
+            System.out.println( "第"+(i+1)+"次输出hello world");
+            //System.out.println( "第"+(i++)+"次输出hello world");
+        }
+
+        //执行流程
+        /*
+            执行 初始化,
+
+            条件判断
+
+            执行 循环体
+
+            迭代   条件判断    循环体  迭代 判断 为 false 结束。
+         */
+
+
+        //案例2: 输出1-100的奇数数字.
+        for (int i = 1; i <= 100  ; i++){
+            if ( i % 2 != 0 ){
+                System.out.println(i);
+            }
+        }
+
+
+        //案例3: 算出1-100的偶数数字的总和.
+        int sum = 0;
+
+        for (int i = 1; i <= 100; i++) {
+
+            if (i % 2 ==0){
+                //和
+                sum +=i; // sum = sum + i;
+            }
+        }
+
+        System.out.println("和"+sum);
+
+
+    }
+}

+ 76 - 0
JavaSE/day03/src/Test06.java

@@ -0,0 +1,76 @@
+import java.util.Scanner;
+
+/**
+ * ClassName: Test06 while循环
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 15:24
+ * @Version 1.0
+ */
+public class Test06 {
+
+    public static void main(String[] args) {
+        //10 次helloworld
+
+        //初始化 1
+        int i = 0;
+        //判断 2
+        while ( i < 10 ){
+            //循环体 3
+            System.out.println((i+1)+"helloworld");
+            //迭代 4
+            i++;
+        }
+        // 1 2 3 4 2 3 4
+
+
+        // 案例1:
+        // 水井深12米,青蛙第一天跳1米,之后每天比前一天多跳0.2米.请问几天能跳出井.
+        double l = 12;
+        int days = 0;
+        double a = 1;
+
+        while (l > 0){
+            //迭代
+            l = l - a;
+
+            //迭代
+            a +=0.2;
+
+            //统计
+            ++days;
+        }
+
+        System.out.println(days);
+
+
+        /*
+        随机生成一个100以内的数,猜这个随机数是多少?
+        从键盘输入数,如果大了,提示大了;如果小了,提示小了;如果对了,就不再猜了,并统计一共猜了多少次。
+        提示:生成一个[a,b] 范围的随机数的方式:(int)(Math.random() * (b - a + 1) + a)
+         */
+
+        //对象
+        Scanner scanner = new Scanner(System.in);
+        //随机数
+        int random = (int) (Math.random()*100);
+        //输入数字
+        System.out.println("请输入1-100之间的数字");
+        int number = scanner.nextInt();
+
+        while ( random != number ){
+            if (number > random){
+                System.out.println("猜大了");
+            }
+
+            if (  number < random){
+                System.out.println("猜小了");
+            }
+            System.out.println("重新输入1-100之间的数字");
+            number = scanner.nextInt();
+        }
+
+        System.out.println("正确:"+number);
+
+    }
+}

+ 26 - 0
JavaSE/day03/src/Test07.java

@@ -0,0 +1,26 @@
+/**
+ * ClassName: Test07
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 16:25
+ * @Version 1.0
+ */
+public class Test07 {
+    /*
+    do while循环
+     */
+
+    public static void main(String[] args) {
+
+        int i = 0;
+        do {
+            System.out.println("hello world");
+            i++;
+        }while (false);
+
+        //无条件执行一次
+
+    }
+
+
+}

+ 57 - 0
JavaSE/day03/src/Test08.java

@@ -0,0 +1,57 @@
+/**
+ * ClassName: 循环嵌套
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/4 16:25
+ * @Version 1.0
+ */
+public class Test08 {
+
+
+    public static void main(String[] args) {
+
+        for (int i = 0; i < 5; i++) {
+            for (int k = 0; k < 5; k++) {
+                System.out.print(" * ");
+            }
+            System.out.println();
+        }
+        // i 行数
+        // k 列数
+
+        /*
+            *
+            * *
+            * * *
+            * * * *
+            * * * * *
+         */
+        for (int i = 1; i <= 5; i++) {
+            for (int j = 1; j <= i  ; j++) {
+                System.out.print(" * ");
+            }
+            System.out.println();
+        }
+
+        System.out.println("---------------------");
+        /*
+
+         * * * * *
+         * * * *
+         * * *
+         * *
+         *
+
+         */
+
+        for (int i = 1; i <= 5; i++) {
+            for (int j = 1; j <= 5 - (i - 1)  ; j++) {
+                System.out.print(" * ");
+            }
+            System.out.println();
+        }
+
+    }
+
+
+}

+ 11 - 0
JavaSE/day04/day04.iml

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

+ 49 - 0
JavaSE/day04/src/com/lc/day04/arr03/Test05.java

@@ -0,0 +1,49 @@
+package com.lc.day04.arr03;
+
+/**
+ * ClassName: Test05
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 10:12
+ * @Version 1.0
+ */
+public class Test05 {
+
+    //数组的使用
+    public static void main(String[] args) {
+        //声明
+        //String[] names;
+
+        //初始化 赋值
+        // 静态初始化 复杂
+        String[] names1 = new String[]{ "张三","李四","坤坤" };
+
+        // 静态初始化 简单
+        int[] ages = {22,26,29};
+
+        // 动态初始化
+        String[] names2 = new String[3];
+
+
+        //引用数据类型 位置 在堆中 回首元素的地址
+        System.out.println(names1); //地址值。[Ljava.lang.String;@4eec7777
+
+        //连续的空间
+        // 下标 0 - 长度-1
+        System.out.println(names1[0]);
+        System.out.println(names1[1]);
+        System.out.println(names1[2]);
+
+        //数组的长度 固定
+        // 属性 length
+        //names1.length = 10; //不可以 更改
+        System.out.println("数组的长度:"+names1.length);
+
+        //通过索引操作效率非常高
+
+        //回首元素的地址 第一个元素的地址。
+
+
+
+    }
+}

+ 29 - 0
JavaSE/day04/src/com/lc/day04/arr04/Test01.java

@@ -0,0 +1,29 @@
+package com.lc.day04.arr04;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 11:01
+ * @Version 1.0
+ */
+public class Test01 {
+    //数组遍历
+    public static void main(String[] args) {
+
+        String[] moves = {"灌篮高手","志愿军","长津湖","北纬38度","金刚川"};
+        //遍历
+        //  moves.length 数组长度
+        for (int i = 0; i < moves.length; i++) {
+            //索引
+            System.out.print(" "+moves[i]);
+        }
+
+        moves[1] = "志愿军:雄兵出击";
+        System.out.println();
+        //遍历
+        for (int i = 0; i < moves.length; i++) {
+            System.out.print(" "+moves[i]);
+        }
+    }
+}

+ 63 - 0
JavaSE/day04/src/com/lc/day04/arr05/Test01.java

@@ -0,0 +1,63 @@
+package com.lc.day04.arr05;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 14:34
+ * @Version 1.0
+ */
+public class Test01 {
+
+    // 创建一个长度为6的int型数组,
+    // 要求数组元素的值都在1-10之间,且是随机赋值元素的值各不相同。
+    /*
+        [ 1 ,2 ,3 ,4  , , ]
+
+        随机数 1  2  3  4  4
+
+        第几个 元素 外层的 i
+
+                   内层循环  比较  是否 重写  通过 i 控制 内层循环 比较次数。
+
+                   标识
+                   i --
+     */
+    public static void main(String[] args) {
+        //数组
+        int[] arr = new int[6];
+
+        for (int i = 0; i < arr.length; i++) {
+            //随机数
+            int random =(int)(Math.random() * 10)+1;
+            //赋值
+            arr[i] = random;
+            //比较
+            for (int k = 0; k < i; k++) {
+                if (arr[k] == random){
+                    i --;
+                    break;
+                }
+            }
+        }
+
+        //Arrays.toString遍历输出
+        System.out.println(Arrays.toString(arr));
+    }
+
+    //动态初始化
+    public static void main1(String[] args) {
+        //数组
+        int[] arr = new int[3];
+
+        //索引
+        arr[0] = 22;
+
+        System.out.println(arr[0]);
+
+    }
+
+
+}

+ 30 - 0
JavaSE/day04/src/com/lc/day04/arr05/Test02.java

@@ -0,0 +1,30 @@
+package com.lc.day04.arr05;
+
+import java.util.Arrays;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 14:34
+ * @Version 1.0
+ */
+public class Test02 {
+
+
+    public static void main(String[] args) {
+        //数组
+        int[] arr = new int[6];
+        System.out.println(arr[0]);
+
+        double[] arr1 = new double[2];
+        System.out.println(arr1[0]); //0.0
+
+        //string
+        String[] arr2 = new String[2];
+
+        System.out.println(arr2[0]); //null
+    }
+
+
+}

+ 35 - 0
JavaSE/day04/src/com/lc/day04/arr06/Test01.java

@@ -0,0 +1,35 @@
+package com.lc.day04.arr06;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 15:22
+ * @Version 1.0
+ */
+public class Test01 {
+    public static void main(String[] args) {
+
+        int[] arr1 = new int[3];
+        int[] arr2 = new int[3];
+        int[] arr3 = new int[3];
+
+        System.out.println(arr1); //7777
+        arr1[0] = 1;
+        arr1[1] = 2;
+        arr1[2] = 3;
+        //地址
+        arr2 = arr1;
+
+        arr3 = arr2;
+
+        System.out.println(arr2[0]); // ?
+        System.out.println(arr2[1]); //
+        System.out.println(arr2[2]); //
+
+
+        System.out.println(arr3[0]);
+        System.out.println(arr3[1]);
+        System.out.println(arr3[2]);
+    }
+}

+ 23 - 0
JavaSE/day04/src/com/lc/day04/arr07/Test01.java

@@ -0,0 +1,23 @@
+package com.lc.day04.arr07;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 15:37
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) {
+        int[] arr  = new int[2];
+
+        //ArrayIndexOutOfBoundsException 数组越界
+        //System.out.println(arr[2]); //不存在
+
+        arr = null;
+        System.out.println(arr[0]);
+
+        //NullPointerException 空指针异常
+    }
+}

+ 39 - 0
JavaSE/day04/src/com/lc/day04/bc01/Test01.java

@@ -0,0 +1,39 @@
+package com.lc.day04.bc01;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 9:24
+ * @Version 1.0
+ */
+public class Test01 {
+    //break和continue
+    public static void main(String[] args) {
+
+        //break continue
+        // 关键字后面不能写代码
+        for (int i = 0; i < 10; i++) {
+            if (i == 3 ){
+                //break;
+                continue;
+            }
+            System.out.println("hello "+i);
+        }
+
+        System.out.println("----------------");
+        int k = 0;
+        while (true){
+            if ( k == 3 ){
+                //break;
+                continue;
+            }
+            System.out.println("hello "+k);
+            k++;
+        }
+
+
+        //
+
+    }
+}

+ 62 - 0
JavaSE/day04/src/com/lc/day04/bc02/Test02.java

@@ -0,0 +1,62 @@
+package com.lc.day04.bc02;
+
+/**
+ * ClassName: Test02
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 9:30
+ * @Version 1.0
+ */
+public class Test02 {
+    /*
+    **题目:找出100以内所有的素数(质数)?100000以内的呢?**
+
+    目的:不同的代码的实现方式,可以效率差别很大。
+
+    分析:素数(质数):只能被1和它本身整除的自然数。  --->
+    从2开始,到这个数-1为止,此范围内没有这个数的约数。则此数是一个质数。
+    比如:2、3、5、7、11、13、17、19、23、...
+
+        3-100
+        3 取模  2
+        4 取模  2 3
+        5 取模  2 3 4
+        *
+        100  取模  2 - 99
+        *
+
+        标志 判断
+
+        外循环 素数判断
+
+        内循环  素数条件
+     */
+    public static void main(String[] args) {
+        //时间
+        long start = System.currentTimeMillis();
+        // 1-100
+        for (int i = 3; i < 100000; i++) {
+            //标识
+            boolean flag = true;
+
+            //素数条件
+            for (int j = 2; j < i; j++) {
+                //取模 判断
+                if ( i % j == 0 ){
+                    //标识
+                    flag = false;
+                }
+            }
+            //判断
+            if (flag){
+                //System.out.println(i +"是质数");
+            }
+        }
+
+        long end = System.currentTimeMillis();
+
+        //时间
+        System.out.println(end - start);
+
+    }
+}

+ 66 - 0
JavaSE/day04/src/com/lc/day04/bc02/Test03.java

@@ -0,0 +1,66 @@
+package com.lc.day04.bc02;
+
+/**
+ * ClassName: Test02
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 9:30
+ * @Version 1.0
+ */
+public class Test03 {
+    /*
+    **题目:找出100以内所有的素数(质数)?100000以内的呢?**
+
+    目的:不同的代码的实现方式,可以效率差别很大。
+
+    分析:素数(质数):只能被1和它本身整除的自然数。  --->
+    从2开始,到这个数-1为止,此范围内没有这个数的约数。则此数是一个质数。
+    比如:2、3、5、7、11、13、17、19、23、...
+
+        3-100
+        3 取模  2
+        4 取模  2 3
+        5 取模  2 3 4
+        *
+
+        36 取模 2 - 6
+        100  取模  2 - 99
+        *
+
+        标志 判断
+
+        外循环 素数判断
+
+        内循环  素数条件
+     */
+    public static void main(String[] args) {
+        //时间
+        long start = System.currentTimeMillis();
+        // 1-100
+        for (int i = 3; i < 100000; i++) {
+            //标识
+            boolean flag = true;
+
+            //素数条件  i 开方
+            for (int j = 2; j <= Math.sqrt(i); j++) {
+                //取模 判断
+                if ( i % j == 0 ){
+                    //标识
+                    flag = false;
+                    // 停止
+                    break;
+                }
+            }
+            //判断
+            if (flag){
+                //System.out.println(i +"是质数");
+            }
+        }
+
+        long end = System.currentTimeMillis();
+
+        //时间
+        System.out.println(end - start);
+
+    }
+}

+ 27 - 0
JavaSE/day04/src/com/lc/day04/bc02/Test04.java

@@ -0,0 +1,27 @@
+package com.lc.day04.bc02;
+
+/**
+ * ClassName: Test04
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 9:59
+ * @Version 1.0
+ */
+public class Test04 {
+    //死循环
+    public static void main(String[] args) {
+
+        //死循环
+//        while (true){
+//            System.out.println("1");
+//        }
+
+        for (;true ; ) {
+            System.out.println("1");
+        }
+
+        //后面不能写代码
+        //System.out.println("123");
+    }
+
+}

+ 52 - 0
JavaSE/day04/src/com/lc/day04/exer01/Test01.java

@@ -0,0 +1,52 @@
+package com.lc.day04.exer01;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 10:49
+ * @Version 1.0
+ */
+public class Test01 {
+    /*
+    - 声明String数组,记录你最喜欢电影的名称最少5部。
+    - 声明String数组,记录你最喜欢的女演员 最少6位。
+    - 声明double数组,记录你最最近的体重状况 6天。
+    - 使用 下标查看第一个数组的 第2部电影
+    - 使用 下标查看第二个数组的 第3位演员
+    - 使用 下标查看第三个数组的 第4天的体重 输出
+    - 修改第一个数组 的第三部电影为  《志愿军:雄兵出击》
+    - 修改第二个数组 的最后一位为  徐帆
+     */
+    public static void main(String[] args) {
+
+        //数组的声明和初始化
+        String[] moves = {"灌篮高手","志愿军","长津湖","北纬38度","金刚川"};
+
+        String[] names = {"坤坤","峰峰","凡凡","赵丽颖","杨幂"};
+
+        double[] weight = {80.0,81.2,82.3,84.2,83.2};
+
+        //操作
+        //  长度  名称.length 数组的长度, 不可变。
+        // 下标   0 开始, 数组的长度 - 1 结束。
+        //       连续  每次 加1.
+        //  数组名[下标]
+        System.out.println(moves[1]);
+        System.out.println(names[2]);
+        System.out.println(weight[4]);
+
+        // 修改
+        moves[2] = "志愿军:雄兵出击";
+
+        // 最后一位 length
+        names[names.length - 1] = "徐帆";
+
+        System.out.println(moves[2]);
+        System.out.println(names[names.length - 1]);
+
+
+    }
+
+
+}

+ 76 - 0
JavaSE/day04/src/com/lc/day04/exer01/Test02.java

@@ -0,0 +1,76 @@
+package com.lc.day04.exer01;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 10:49
+ * @Version 1.0
+ */
+public class Test02 {
+    public static void main(String[] args) {
+        //求数组元素的最小值  索引位置
+        int[] arr = {101, 10, 29, 234, 2345, 64356, 123 , 10 , 10};
+
+        int min = arr[0];
+
+        //索引
+        String index = "";
+
+        for (int i = 0; i < arr.length; i++) {
+            if (arr[i] < min){
+                min = arr[i];
+
+                //索引
+                index = i+"";
+            }
+        }
+
+        System.out.println("索引:"+index +"最小值:"+min);
+
+    }
+
+    public static void main2(String[] args) {
+        //求数组元素的最大值
+        int[] arr = {1, 10, 29, 234, 2345, 64356, 123};
+
+        //定义数组的第一个
+        int max = arr[0];
+
+        //循环
+        for (int i = 0; i < arr.length; i++) {
+            //大于最大值替换
+            if (arr[i] > max){
+                //替换
+                max = arr[i];
+            }
+        }
+
+        System.out.println("最大值:"+max);
+
+
+    }
+
+    public static void main1(String[] args) {
+        //数组统计:求总和、均值
+        int[] arr = {1,10,29,234,2345,64356,123};
+
+        //标识 和
+        int sum = 0;
+
+        for (int i = 0; i < arr.length; i++) {
+            //加=
+            sum = sum + arr[i];
+        }
+
+        System.out.println("数组的和:"+sum);
+
+        //平均数
+        int i = sum / arr.length;
+        System.out.println("数组的平均值:"+i);
+
+
+    }
+
+
+}

+ 34 - 0
JavaSE/day04/src/com/lc/day04/exer01/Test03.java

@@ -0,0 +1,34 @@
+package com.lc.day04.exer01;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 10:49
+ * @Version 1.0
+ */
+public class Test03 {
+    public static void main(String[] args) {
+        //找最值及其所有最值的下标
+        int[] arr = {101, 12, 29, 234, 10 ,2345, 64356, 123, 10, 10};
+
+        //索引
+        String index = "";
+        //最小值
+        int min = arr[0];
+
+        for (int i = 0; i < arr.length; i++) {
+            if ( arr[i] < min ){
+                min = arr[i];
+                index = i+"";
+            }else if ( arr[i] == min ){
+                index += ","+i;
+            }
+        }
+
+        System.out.println("index:"+index);
+        System.out.println("min:"+min);
+    }
+
+
+}

+ 42 - 0
JavaSE/day04/src/com/lc/day04/exer01/Test04.java

@@ -0,0 +1,42 @@
+package com.lc.day04.exer01;
+
+/**
+ * ClassName: Test04
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 14:12
+ * @Version 1.0
+ */
+public class Test04 {
+    public static void main(String[] args) {
+        /*
+            数组 :和
+            最大子数组 : 和
+
+            数组和 比较  最大子数组
+                大于 替换
+                小于 0 舍弃
+         */
+
+        int[] arr = {1, -2, 3, 10, -4, 7, 2, -5};
+
+        int sum = 0;
+
+        int maxSum = 0;
+
+        for (int i = 0; i < arr.length; i++) {
+            //数组和
+            sum+=arr[i];
+            if (sum < 0){
+                sum = 0;
+            }
+
+            // 大于
+            if (sum > maxSum){
+                maxSum = sum;
+            }
+        }
+
+        System.out.println(maxSum);
+    }
+}

+ 95 - 0
JavaSE/day04/src/com/lc/day04/exer02/Test01.java

@@ -0,0 +1,95 @@
+package com.lc.day04.exer02;
+
+import java.util.Scanner;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 16:05
+ * @Version 1.0
+ */
+public class Test01 {
+
+    /*
+        准备内容
+     */
+    public static void main(String[] args) throws InterruptedException {
+        String[] hert = {
+                "你认为精神出轨和肉体出轨哪个比较严重?",
+            "因为什么事情,哭得特别难受?",
+            "哭得最伤心的是哪一次?为什么?",
+            "收到过最难忘的礼物是什么?",
+            "谁是你最崇拜的人?为什么?",
+            "早上吃什么?中午吃什么?晚上吃什么?",
+            "我们在一起你快乐吗?",
+            "有没有自己偷偷看过大片?",
+            "你现在还是单身吗?",
+            "你最想要的5样东西",
+            "裤是什么颜色?"
+        };
+
+        String[] adv = {
+                "原地转十圈然后靠一个人身上",
+                "把右边第一个横抱起来",
+                "挤出护手霜,帮最近的异性涂",
+                "随便抓个人说,我怀了你的孩子",
+                "右手捏住左耳垂,弯下腰,转十圈,再金鸡独立十秒",
+                "吃下每个人为你夹得菜",
+                "抱着正对面人的大腿唱情歌",
+                "选一个男生,锤他胸口,并说“你好厌恶哦”",
+                "学超级名模走秀绕场一周",
+                "想办法让指定的一名异性兴奋起来",
+        };
+
+        String[] person = {"琼月","虞彩","寒雁","琼霎","凤采","惠莹","依枝","雅蕾"};
+
+        //游戏开始
+        System.out.println("----------真心话大冒险游戏-------------");
+        //选人
+        int pIndex = (int) (Math.random()*person.length);
+
+        System.out.println("随机人员是:");
+        for (int i = 0; i < 3; i++) {
+            Thread.sleep(1000);
+            System.out.println((3-i));
+        }
+        //展示人员
+        System.out.println( person[pIndex] );
+
+        while (true){
+            System.out.println(" 选择 1真心话  2 大冒险");
+            Scanner scanner = new Scanner(System.in);
+
+            int i = scanner.nextInt();
+            if ( i != 1 && i != 2 ){
+                System.out.println("请输入 1 或者 2");
+            }
+
+            switch (i){
+                case 1:
+                    int hIndex = (int) (Math.random()*hert.length);
+                    System.out.println("内容是:");
+                    System.out.println();
+                    System.out.println(hert[hIndex]);
+                    break;
+                case 2:
+                    int aIndex = (int) (Math.random()*adv.length);
+                    System.out.println("内容是:");
+                    System.out.println();
+                    System.out.println(adv[aIndex]);
+                    break;
+            }
+
+            System.out.println("是否继续游戏");
+            System.out.println("1 继续  2 退出");
+            int num = scanner.nextInt();
+            if (num == 2){
+                break;
+            }
+        }
+
+
+    }
+
+}

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

@@ -0,0 +1,91 @@
+package com.lc.day04.exer02;
+
+import java.util.Arrays;
+import java.util.Scanner;
+
+/**
+ * ClassName: Test01
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/11 16:05
+ * @Version 1.0
+ */
+public class Test02 {
+
+
+    public static void main(String[] args) throws InterruptedException {
+        int[] blueArr = new int[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;
+                }
+            }
+        }
+
+
+        int[] inputBlueArr = new int[5];
+        //输入
+        Scanner sc = new Scanner(System.in);
+        for (int i = 0; i < 5; i++) {
+            System.out.println("请输入第"+(i+1)+"个蓝球");
+            int num = sc.nextInt();
+
+            inputBlueArr[i] = num;
+            //比较
+            for (int k = 0; k < i; k++) {
+                if (inputBlueArr[k] == num){
+                    i --;
+                    System.out.println("请重新输入");
+                    break;
+                }
+            }
+        }
+
+        int redBall = (int)(Math.random() * 7)+1;
+        System.out.println("请输入红球");
+
+        int inputRedBall = sc.nextInt();
+
+        //比较
+        int count = 0;
+
+        for (int i = 0; i < blueArr.length; i++) {
+            for (int k = 0; k < inputBlueArr.length; k++) {
+                if ( blueArr[i] == inputBlueArr[k] ){
+                    count++;
+                }
+            }
+        }
+
+        if ( count == 5 && inputRedBall == redBall ){
+            System.out.println("一等奖");
+        }  else if ( count == 5  ){
+            System.out.println("二等奖");
+        }  else if ( count == 3 && inputRedBall == redBall ){
+            System.out.println("三等奖");
+        }  else if ( count == 3  ){
+            System.out.println("四等奖");
+        }  else if ( count == 2 && inputRedBall == redBall ){
+            System.out.println("五等奖");
+        }  else if ( count == 2 || inputRedBall == redBall ){
+            System.out.println("六等奖");
+        }  else {
+            System.out.println("遗憾");
+        }
+
+        System.out.println(Arrays.toString(blueArr));
+        System.out.println(Arrays.toString(inputBlueArr));
+
+        System.out.println("红:"+redBall+"-输入红球:"+inputRedBall);
+        System.out.println(count);
+    }
+
+}

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

@@ -0,0 +1,178 @@
+package com.lc.day04.exer02;
+
+import java.util.Scanner;
+
+/**
+ * ClassName: Test03
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/11/12 17:02
+ * @Version 1.0
+ */
+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;
+
+            System.out.println("你想要多少钱作为起始资金");
+            money=scanner.nextInt();
+
+            while(true) {
+                int get=0; ori=money;
+                System.out.println("输入你的下注以及基础倍率");
+                System.out.println("下注为");
+                int in = scanner.nextInt();
+                System.out.println("你还剩下"+(money-in)+"元");
+                while(true) {
+                    System.out.println("你要的基础倍率为(基础倍率每加1,入场费加五十,入场费的基础为100)");
+                    bei = scanner.nextInt();
+                    getin = 50 * bei;
+                    System.out.println("入场费为"+getin+"确定吗??(true or false)");
+                    boolean toopen=scanner.nextBoolean();
+                    if(toopen==false){
+                        continue;
+                    }
+                    System.out.println("输入完毕");
+                    break;
+                }
+                money=money-in-getin;
+                if(money<0)
+                {
+                    System.out.println("你的钱不够,不该来这里");
+                    continue;
+                }
+                System.out.println("你还剩下"+money+"元");
+                int[] input_1 = new int[5];
+                int input;
+                boolean judge = true;
+                System.out.println("输入五个红色球(1~36)");
+                while (true)
+                {
+                    for (int i = 0; i < 5; i++)
+                    {
+                        input_1[i] = scanner.nextInt();
+                        for(int j=0;j<i;j++)
+                        {
+                            if(input_1[i]==input_1[j])
+                            {
+                                judge=false;
+                                System.out.println("数据输入有误,请输入不重复的数据");
+                                break;
+                            }
+                        }
+                        if(input_1[i]>36||input_1[i]<=0)
+                        {
+                            judge=false;
+                            System.out.println("数据输入错误,重新输入(1~36)");
+                            break;
+                        }
+                        else if(input_1[i]>=0&&input_1[i]<=36)
+                        {
+                            if(4-i!=0)
+                                System.out.println("还需输入" + (4 - i) + "个");
+                            else if(4-i==0)
+                                System.out.println("输入完毕");
+                        }
+                    }
+                    if(judge==false)
+                    {
+                        judge=true;
+                        continue;
+                    }
+                    if(judge==true)
+                        break;
+                }
+
+
+
+
+                while(true){
+                    System.out.println("输入蓝球");
+                    input = scanner.nextInt();
+                    if(input>7) {
+                        System.out.println("重新输入");
+                        continue;
+                    }
+                    break;}
+                int[] output = new int[5];
+                for (int i = 0; i < 5; i++) {
+                    output[i] = (int) (Math.random() * 100) % 35 + 1;
+                    int r = output[i];
+                    for (int j = 0; j < i; j++)
+                        if (r == output[j]) {
+                            i--;
+                            break;
+                        }
+                }
+                int output_1 = (int) (Math.random() * 10) % 7 + 1;
+                int red = 0, blue = 0;
+                for (int i = 0; i < 5; i++) {
+                    for (int j = 0; j < 5; j++) {
+                        if (input_1[i] == output[j])
+                            red++;
+                    }
+                }
+                if (input == output_1)
+                    blue++;
+                System.out.println("开奖啦!!!");
+
+                System.out.println("红球即将出现!!!");
+
+                for(int i=0;i<5;i++)
+                {  System.out.print("第"+(i+1)+"个红球是---");
+                    try {
+                        Thread.sleep(1000);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                    System.out.println(output[i]+" ");
+                }
+                System.out.println("你猜的是");
+                for(int i=0;i<5;i++) {
+
+                    System.out.print(input_1[i]);
+                }
+                System.out.println("蓝球即将揭晓!!");try {
+                    Thread.sleep(2000);
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                }
+                if(blue==1)
+                    System.out.println(output_1+"你猜对啦!!!!");
+                else if(blue==0)
+                    System.out.println("很遗憾,蓝球是"+output_1+"而你猜的是"+input);
+                System.out.println("你猜对了"+"red"+"个红球");
+                if (red >= 2) {
+                    for (int i = 0; i < red; i++)
+                        bei *= 200;
+                    if (blue == 1)
+                        bei *= 5000;
+                    get = in * bei;
+                    money = money+ get;
+
+                } else if(red<2)
+                    ;
+                if(ori-money<0)
+                    System.out.println("你挣了"+(money-ori)+"元");
+                else if(ori-money>0)
+                    System.out.println("你亏了"+(ori-money)+"元");
+                System.out.println("你现在还有" + money + "元");
+                if(money<0)
+                    break;
+                else
+                {
+                    System.out.println("继续玩吗??(true/false)");
+                    play = scanner.nextBoolean();
+                    if (play == false)
+                        break;
+                }
+
+            }
+            System.out.println("游戏结束,你最终有"+money+"元");
+
+
+
+        }
+
+
+}

+ 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 {
+
+    /*
+    双色球(蓝球“35选5”+红球“7选1”),即蓝球在1-35之间的号码中随机选取5个,
+    红球在1-7之间的号码中随机选取1个,组成一期的中奖号码,和用户输入的 进行比较进行开奖。
+    开发提示:
+
+    - 声明一个int类型的 蓝球 数组before,长度为5,5个不同的数字(不重复);
+    - 声明一个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;
+
+
+    //行为  方法
+    /*
+    【public】 void 方法名称(){
+        方法体
+    }
+     */
+    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;
+    }
+
+
+}

部分文件因文件數量過多而無法顯示