xerga 1 year ago
parent
commit
d05dce1d34
100 changed files with 3798 additions and 194 deletions
  1. 1 1
      01_JavaSe/JavaSe/.idea/misc.xml
  2. 3 0
      01_JavaSe/JavaSe/.idea/modules.xml
  3. 166 192
      01_JavaSe/JavaSe/.idea/workspace.xml
  4. 4 1
      01_JavaSe/JavaSe/JavaSe.iml
  5. 38 0
      01_JavaSe/JavaSe/day09/src/com/lc/day09/test6/ReturnExceptionDemo.java
  6. 29 0
      01_JavaSe/JavaSe/day10/.gitignore
  7. 21 0
      01_JavaSe/JavaSe/day10/day10.iml
  8. 40 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/tes1/Communication.java
  9. 51 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/test/DeadLockTest.java
  10. 22 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/test/HungrySingle.java
  11. 43 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/test/HungrySingleTest.java
  12. 40 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/test/LazyOne.java
  13. 24 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/test/LazySingle.java
  14. 46 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/test/Test01.java
  15. 36 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/test/ThreadStateTest.java
  16. 41 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/test/Ticket.java
  17. 52 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/test/TicketRujable.java
  18. 41 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test01.java
  19. 35 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test02.java
  20. 27 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test03.java
  21. 65 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test04.java
  22. 79 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test05.java
  23. 89 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test06_try.java
  24. 55 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test07_try.java
  25. 53 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test08_throws.java
  26. 33 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test09_method_throws.java
  27. 78 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test10_throws.java
  28. 29 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/ex/MyException.java
  29. 27 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/ex/TestMyException.java
  30. 33 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/exer1/PersonNumberException.java
  31. 42 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/exer1/Register.java
  32. 22 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/exer2/NotTriangleException.java
  33. 30 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/exer2/TestTriangle.java
  34. 42 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/exer2/Triangle.java
  35. 39 0
      01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/exer3/ReturnExceptionDemo.java
  36. 29 0
      01_JavaSe/JavaSe/day11/.gitignore
  37. 11 0
      01_JavaSe/JavaSe/day11/day11.iml
  38. 55 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/exer/exer1/Test01.java
  39. 39 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/exer/exer1/Test02.java
  40. 65 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/exer/exer1/Test03.java
  41. 43 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/exer/exer1/Test04.java
  42. 37 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/test/TicketRunnable.java
  43. 21 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/test/TicketTest.java
  44. 23 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/test1/Test.java
  45. 31 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/test1/TicketRunnable.java
  46. 43 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/test2/Communction.java
  47. 43 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/test2/Communction1.java
  48. 122 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/test2/ConsumerProducerTest.java
  49. 31 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/test3/Consumer.java
  50. 31 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/test3/Producer.java
  51. 51 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/test3/Product.java
  52. 25 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/test3/Test.java
  53. 34 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/test4/CallableTest.java
  54. 27 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/test4/NumThread.java
  55. 81 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/test5/CalendarTest.java
  56. 80 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/test5/ThreadPool.java
  57. 31 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/thread1/Test01.java
  58. 21 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/thread2/MyThread.java
  59. 19 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/thread2/MyThread2.java
  60. 33 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/thread2/TestMyThread.java
  61. 81 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/thread3/Test01.java
  62. 28 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/thread3/Ticket.java
  63. 32 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/thread3/TicketRunable.java
  64. 34 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/thread3/WindowTicket.java
  65. 61 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/thread4/TestTicket.java
  66. 32 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/thread4/TestTicketRunable.java
  67. 26 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/thread4/TestWindowTicket.java
  68. 32 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/thread4/Ticket.java
  69. 35 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/thread4/TicketRunable.java
  70. 37 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/thread4/WindowTicket.java
  71. 54 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/thread5/HungrySingle.java
  72. 54 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/thread5/LazyOne.java
  73. 25 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/thread5/LazySingle.java
  74. 45 0
      01_JavaSe/JavaSe/day11/src/com/lc/day11/thread5/TestLazyOne.java
  75. 29 0
      01_JavaSe/JavaSe/day12/.gitignore
  76. 21 0
      01_JavaSe/JavaSe/day12/day12.iml
  77. 58 0
      01_JavaSe/JavaSe/day12/src/com/lc/day12/exer/TestString01.java
  78. 16 0
      01_JavaSe/JavaSe/day12/src/com/lc/day12/string4/Person.java
  79. 26 0
      01_JavaSe/JavaSe/day12/src/com/lc/day12/string4/StringTest.java
  80. 92 0
      01_JavaSe/JavaSe/day12/src/com/lc/day12/string4/Test01.java
  81. 137 0
      01_JavaSe/JavaSe/day12/src/com/lc/day12/string5/TestString.java
  82. 41 0
      01_JavaSe/JavaSe/day12/src/com/lc/day12/thread1/PrintNumber.java
  83. 25 0
      01_JavaSe/JavaSe/day12/src/com/lc/day12/thread1/TestPrintNumber.java
  84. 31 0
      01_JavaSe/JavaSe/day12/src/com/lc/day12/thread2/Comsumer.java
  85. 31 0
      01_JavaSe/JavaSe/day12/src/com/lc/day12/thread2/Producer.java
  86. 52 0
      01_JavaSe/JavaSe/day12/src/com/lc/day12/thread2/Product.java
  87. 38 0
      01_JavaSe/JavaSe/day12/src/com/lc/day12/thread2/TestProduct.java
  88. 19 0
      01_JavaSe/JavaSe/day12/src/com/lc/day12/thread3/MyRunable.java
  89. 26 0
      01_JavaSe/JavaSe/day12/src/com/lc/day12/thread3/SumNumber.java
  90. 35 0
      01_JavaSe/JavaSe/day12/src/com/lc/day12/thread3/Test01.java
  91. 43 0
      01_JavaSe/JavaSe/day12/src/com/lc/day12/thread3/Test02.java
  92. BIN
      01_JavaSe/JavaSe/out/production/day09/com/lc/day09/test6/ReturnExceptionDemo.class
  93. BIN
      01_JavaSe/JavaSe/out/production/day10/com/lc/day10/tes1/Communication.class
  94. BIN
      01_JavaSe/JavaSe/out/production/day10/com/lc/day10/test/DeadLockTest$1.class
  95. BIN
      01_JavaSe/JavaSe/out/production/day10/com/lc/day10/test/DeadLockTest$2.class
  96. BIN
      01_JavaSe/JavaSe/out/production/day10/com/lc/day10/test/DeadLockTest.class
  97. BIN
      01_JavaSe/JavaSe/out/production/day10/com/lc/day10/test/HungrySingle.class
  98. BIN
      01_JavaSe/JavaSe/out/production/day10/com/lc/day10/test/HungrySingleTest$1.class
  99. BIN
      01_JavaSe/JavaSe/out/production/day10/com/lc/day10/test/HungrySingleTest$2.class
  100. BIN
      01_JavaSe/JavaSe/out/production/day10/com/lc/day10/test/HungrySingleTest.class

+ 1 - 1
01_JavaSe/JavaSe/.idea/misc.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_17_PREVIEW" project-jdk-name="17" project-jdk-type="JavaSDK">
+  <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>

+ 3 - 0
01_JavaSe/JavaSe/.idea/modules.xml

@@ -12,6 +12,9 @@
       <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>

+ 166 - 192
01_JavaSe/JavaSe/.idea/workspace.xml

@@ -5,137 +5,87 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="12140050-64bb-493c-b359-1ac1fbbf3cc2" name="Changes" comment="">
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/exer/exer1/Account.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/exer/exer1/CheckAccount.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/exer/exer1/Test.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/exer/exer2/a/FieldMethodTest.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/exer/exer2/b/InterviewTest1.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/exer/exer2/c/InterviewTest2.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/exer/exer3/Circle.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/exer/exer3/GeometricObject.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/exer/exer3/GeometricTest.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/exer/exer3/MyRectangle.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/obj8/Person.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/obj8/Test.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/overwrite1/DemeRideMethod1.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/overwrite1/Phone.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/overwrite1/SmartPhone.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/polymorphism5/Animal.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/polymorphism5/AnimalShop.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/polymorphism5/Cat.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/polymorphism5/Dog.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/polymorphism5/Person.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/polymorphism5/Test.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/polymorphism5/TestVariable.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/polymorphism6/A.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/polymorphism6/B.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/polymorphism6/C.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/polymorphism6/Person.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/polymorphism6/Son.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/polymorphism6/Test.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/polymorphism7/A.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/polymorphism7/B.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/polymorphism7/C.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/polymorphism7/Test.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/polymorphism7/Word.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/super2/Person.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/super2/Student.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/super2/Test.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/super3/Test.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/super4/Dog.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/test/OtherThing.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day07/src/com/lc/day07/test/StaticTest.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/abstract5/Animal.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/abstract5/Cat.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/abstract5/Test.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/abstract6/BankTemplateMethod.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/abstract6/Employee.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/abstract6/Test.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/exer/exer1/Son.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/exer/exer2/Test04.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/exer/exer3/Something.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/exer/exer3/Something1.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/exer/exer4/RiverBarge.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/exer/exer4/Truck.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/exer/exer4/Vehicle.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/exer/exer5/Employee.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/exer/exer5/HourlyEmployee.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/exer/exer5/MyDate.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/exer/exer5/PayrollSystem.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/exer/exer5/SalariedEmployee.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/final5/SmallStudent.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/final5/Student.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/final5/Test.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface10/USB.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface10/USB2.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface10/USB3.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface11/A.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface11/B.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface11/C.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface11/D.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface7/Compter.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface7/Flash.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface7/Mouse.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface7/Test.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface7/Usb3.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface8/A.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface8/B.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface8/C.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface8/D.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface9/BoyFriend.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface9/Father.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface9/Friend.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface9/Son.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/inte/interface9/Test.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/keyword4/Person.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/keyword4/Student.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/keyword4/TestPerson.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/keyword4/TestStudent.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/singleton3/Singleton1.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/singleton3/Singleton2.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/singleton3/Test.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/static1/Person.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/static1/Test.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/static2/Father.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/static2/Son.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/static2/Test.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day08/src/com/lc/day08/test/com/lc/day08/TestAnnotation.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/anno4/DemoAnnotion.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/anno5/Column.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/anno5/Table.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/anno5/User.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/baozhuang7/Demo01.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/baozhuang7/Demo02.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/baozhuang7/TestExam.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/enum2/Season.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/enum2/Seasona.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/enum2/TestSeason.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/enum2/TestWeek.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/enum2/Week.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/enum3/DemoEnum01.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/enum3/Season.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/exer/exer1/Ball.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/exer/exer1/C.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/exer/exer2/Circle.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/exer/exer2/ComparableCircle.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/exer/exer2/CompareObject.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/exer/exer2/InterfaceTest.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/exer/exer3/Bicycle.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/exer/exer3/Car.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/exer/exer3/Dev.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/exer/exer3/ElectricVehicle.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/exer/exer3/IPower.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/exer/exer3/Test.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/exer/exer3/Vehicle.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/exer/exer4/A.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/exer/exer4/Test.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/exer/exer4/TestA.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/inner1/DemoInner.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/inner1/MethodClass.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/inner1/NoNameClassObj.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/inner1/OutClass.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/test6/Test01.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/day06/src/com/lc/day06/Inheritance04/Test.java" beforeDir="false" afterPath="$PROJECT_DIR$/day06/src/com/lc/day06/Inheritance04/Test.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day09/src/com/lc/day09/test6/ReturnExceptionDemo.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/tes1/Communication.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/test/DeadLockTest.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/test/HungrySingle.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/test/HungrySingleTest.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/test/LazyOne.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/test/LazySingle.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/test/Test01.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/test/ThreadStateTest.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/test/Ticket.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/test/TicketRujable.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/thowable1/Test01.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/thowable1/Test02.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/thowable1/Test03.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/thowable1/Test04.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/thowable1/Test05.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/thowable1/Test06_try.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/thowable1/Test07_try.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/thowable1/Test08_throws.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/thowable1/Test09_method_throws.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/thowable1/Test10_throws.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/thowable1/ex/MyException.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/thowable1/ex/TestMyException.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/thowable1/exer1/PersonNumberException.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/thowable1/exer1/Register.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/thowable1/exer2/NotTriangleException.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/thowable1/exer2/TestTriangle.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/thowable1/exer2/Triangle.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day10/src/com/lc/day10/thowable1/exer3/ReturnExceptionDemo.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/exer/exer1/Test01.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/exer/exer1/Test02.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/exer/exer1/Test03.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/exer/exer1/Test04.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/test/TicketRunnable.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/test/TicketTest.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/test1/Test.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/test1/TicketRunnable.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/test2/Communction.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/test2/Communction1.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/test2/ConsumerProducerTest.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/test3/Consumer.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/test3/Producer.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/test3/Product.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/test3/Test.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/test4/CallableTest.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/test4/NumThread.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/test5/CalendarTest.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/test5/ThreadPool.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/thread1/Test01.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/thread2/MyThread.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/thread2/MyThread2.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/thread2/TestMyThread.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/thread3/Test01.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/thread3/Ticket.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/thread3/TicketRunable.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/thread3/WindowTicket.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/thread4/TestTicket.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/thread4/TestTicketRunable.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/thread4/TestWindowTicket.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/thread4/Ticket.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/thread4/TicketRunable.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/thread4/WindowTicket.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/thread5/HungrySingle.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/thread5/LazyOne.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/thread5/LazySingle.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day11/src/com/lc/day11/thread5/TestLazyOne.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day12/src/com/lc/day12/exer/TestString01.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day12/src/com/lc/day12/string4/Person.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day12/src/com/lc/day12/string4/StringTest.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day12/src/com/lc/day12/string4/Test01.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day12/src/com/lc/day12/string5/TestString.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day12/src/com/lc/day12/thread1/PrintNumber.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day12/src/com/lc/day12/thread1/TestPrintNumber.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day12/src/com/lc/day12/thread2/Comsumer.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day12/src/com/lc/day12/thread2/Producer.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day12/src/com/lc/day12/thread2/Product.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day12/src/com/lc/day12/thread2/TestProduct.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day12/src/com/lc/day12/thread3/MyRunable.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day12/src/com/lc/day12/thread3/SumNumber.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day12/src/com/lc/day12/thread3/Test01.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/day12/src/com/lc/day12/thread3/Test02.java" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -179,44 +129,48 @@
     <option name="hideEmptyMiddlePackages" value="true" />
     <option name="showLibraryContents" value="true" />
   </component>
-  <component name="PropertiesComponent"><![CDATA[{
-  "keyToString": {
-    "Downloaded.Files.Path.Enabled": "false",
-    "Repository.Attach.Annotations": "false",
-    "Repository.Attach.JavaDocs": "false",
-    "Repository.Attach.Sources": "false",
-    "RunOnceActivity.OpenProjectViewOnStart": "true",
-    "RunOnceActivity.ShowReadmeOnStart": "true",
-    "WebServerToolWindowFactoryState": "false",
-    "jdk.selected.JAVA_MODULE": "17",
-    "node.js.detected.package.eslint": "true",
-    "node.js.detected.package.tslint": "true",
-    "node.js.selected.package.eslint": "(autodetect)",
-    "node.js.selected.package.tslint": "(autodetect)",
-    "nodejs_package_manager_path": "npm",
-    "project.structure.last.edited": "Modules",
-    "project.structure.proportion": "0.15",
-    "project.structure.side.proportion": "0.2908046",
-    "settings.editor.selected.configurable": "reference.projectsettings.compiler.javacompiler",
-    "vue.rearranger.settings.migration": "true"
+  <component name="PropertiesComponent">{
+  &quot;keyToString&quot;: {
+    &quot;Downloaded.Files.Path.Enabled&quot;: &quot;false&quot;,
+    &quot;Repository.Attach.Annotations&quot;: &quot;false&quot;,
+    &quot;Repository.Attach.JavaDocs&quot;: &quot;false&quot;,
+    &quot;Repository.Attach.Sources&quot;: &quot;false&quot;,
+    &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
+    &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
+    &quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
+    &quot;jdk.selected.JAVA_MODULE&quot;: &quot;17&quot;,
+    &quot;last_opened_file_path&quot;: &quot;C:/LoveCoding/VIP-27/code/01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1&quot;,
+    &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
+    &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
+    &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
+    &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
+    &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
+    &quot;project.structure.last.edited&quot;: &quot;Modules&quot;,
+    &quot;project.structure.proportion&quot;: &quot;0.15&quot;,
+    &quot;project.structure.side.proportion&quot;: &quot;0.2908046&quot;,
+    &quot;settings.editor.selected.configurable&quot;: &quot;editing.templates&quot;,
+    &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
   }
-}]]></component>
+}</component>
   <component name="RecentsManager">
+    <key name="CopyFile.RECENT_KEYS">
+      <recent name="C:\LoveCoding\VIP-27\code\01_JavaSe\JavaSe\day10\src\com\lc\day10\thowable1" />
+    </key>
     <key name="CopyClassDialog.RECENTS_KEY">
-      <recent name="com.lc.day09.enum2" />
-      <recent name="com.lc.day08.inte.interface10" />
-      <recent name="com.lc.day08.singleton3" />
-      <recent name="com.lc.day07.exer.exer1" />
-      <recent name="com.lc.day06.exer.exer5" />
+      <recent name="com.lc.day12.thread3" />
+      <recent name="com.lc.day12.thread2" />
+      <recent name="com.lc.day12.thread1" />
+      <recent name="com.lc.day11.test2" />
+      <recent name="com.lc.day11.thread5" />
     </key>
   </component>
-  <component name="RunManager" selected="JUnit.Demo02.test03">
-    <configuration name="TestExam" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
-      <option name="MAIN_CLASS_NAME" value="com.lc.day09.baozhuang7.TestExam" />
-      <module name="day09" />
+  <component name="RunManager" selected="JUnit.TestString.test04">
+    <configuration name="TestString01" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
+      <option name="MAIN_CLASS_NAME" value="com.lc.day12.exer.TestString01" />
+      <module name="day12" />
       <extension name="coverage">
         <pattern>
-          <option name="PATTERN" value="com.lc.day09.baozhuang7.*" />
+          <option name="PATTERN" value="com.lc.day12.exer.*" />
           <option name="ENABLED" value="true" />
         </pattern>
       </extension>
@@ -224,65 +178,64 @@
         <option name="Make" enabled="true" />
       </method>
     </configuration>
-    <configuration name="Demo01.test02" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
-      <module name="day09" />
+    <configuration name="TestString" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
+      <module name="day12" />
       <extension name="coverage">
         <pattern>
-          <option name="PATTERN" value="com.lc.day09.baozhuang7.*" />
+          <option name="PATTERN" value="com.lc.day12.string5.*" />
           <option name="ENABLED" value="true" />
         </pattern>
       </extension>
-      <option name="PACKAGE_NAME" value="com.lc.day09.baozhuang7" />
-      <option name="MAIN_CLASS_NAME" value="com.lc.day09.baozhuang7.Demo01" />
-      <option name="METHOD_NAME" value="test02" />
-      <option name="TEST_OBJECT" value="method" />
+      <option name="PACKAGE_NAME" value="com.lc.day12.string5" />
+      <option name="MAIN_CLASS_NAME" value="com.lc.day12.string5.TestString" />
+      <option name="TEST_OBJECT" value="class" />
       <method v="2">
         <option name="Make" enabled="true" />
       </method>
     </configuration>
-    <configuration name="Demo02.test01" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
-      <module name="day09" />
+    <configuration name="TestString01.test02" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
+      <module name="day12" />
       <extension name="coverage">
         <pattern>
-          <option name="PATTERN" value="com.lc.day09.baozhuang7.*" />
+          <option name="PATTERN" value="com.lc.day12.exer.*" />
           <option name="ENABLED" value="true" />
         </pattern>
       </extension>
-      <option name="PACKAGE_NAME" value="com.lc.day09.baozhuang7" />
-      <option name="MAIN_CLASS_NAME" value="com.lc.day09.baozhuang7.Demo02" />
-      <option name="METHOD_NAME" value="test01" />
+      <option name="PACKAGE_NAME" value="com.lc.day12.exer" />
+      <option name="MAIN_CLASS_NAME" value="com.lc.day12.exer.TestString01" />
+      <option name="METHOD_NAME" value="test02" />
       <option name="TEST_OBJECT" value="method" />
       <method v="2">
         <option name="Make" enabled="true" />
       </method>
     </configuration>
-    <configuration name="Demo02.test02" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
-      <module name="day09" />
+    <configuration name="TestString.test03" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
+      <module name="day12" />
       <extension name="coverage">
         <pattern>
-          <option name="PATTERN" value="com.lc.day09.baozhuang7.*" />
+          <option name="PATTERN" value="com.lc.day12.string5.*" />
           <option name="ENABLED" value="true" />
         </pattern>
       </extension>
-      <option name="PACKAGE_NAME" value="com.lc.day09.baozhuang7" />
-      <option name="MAIN_CLASS_NAME" value="com.lc.day09.baozhuang7.Demo02" />
-      <option name="METHOD_NAME" value="test02" />
+      <option name="PACKAGE_NAME" value="com.lc.day12.string5" />
+      <option name="MAIN_CLASS_NAME" value="com.lc.day12.string5.TestString" />
+      <option name="METHOD_NAME" value="test03" />
       <option name="TEST_OBJECT" value="method" />
       <method v="2">
         <option name="Make" enabled="true" />
       </method>
     </configuration>
-    <configuration name="Demo02.test03" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
-      <module name="day09" />
+    <configuration name="TestString.test04" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
+      <module name="day12" />
       <extension name="coverage">
         <pattern>
-          <option name="PATTERN" value="com.lc.day09.baozhuang7.*" />
+          <option name="PATTERN" value="com.lc.day12.string5.*" />
           <option name="ENABLED" value="true" />
         </pattern>
       </extension>
-      <option name="PACKAGE_NAME" value="com.lc.day09.baozhuang7" />
-      <option name="MAIN_CLASS_NAME" value="com.lc.day09.baozhuang7.Demo02" />
-      <option name="METHOD_NAME" value="test03" />
+      <option name="PACKAGE_NAME" value="com.lc.day12.string5" />
+      <option name="MAIN_CLASS_NAME" value="com.lc.day12.string5.TestString" />
+      <option name="METHOD_NAME" value="test04" />
       <option name="TEST_OBJECT" value="method" />
       <method v="2">
         <option name="Make" enabled="true" />
@@ -290,11 +243,11 @@
     </configuration>
     <recent_temporary>
       <list>
-        <item itemvalue="JUnit.Demo02.test03" />
-        <item itemvalue="Application.TestExam" />
-        <item itemvalue="JUnit.Demo02.test02" />
-        <item itemvalue="JUnit.Demo02.test01" />
-        <item itemvalue="JUnit.Demo01.test02" />
+        <item itemvalue="JUnit.TestString.test04" />
+        <item itemvalue="JUnit.TestString" />
+        <item itemvalue="JUnit.TestString.test03" />
+        <item itemvalue="JUnit.TestString01.test02" />
+        <item itemvalue="Application.TestString01" />
       </list>
     </recent_temporary>
   </component>
@@ -321,6 +274,13 @@
       <workItem from="1690114904679" duration="3000" />
       <workItem from="1690114916552" duration="738000" />
       <workItem from="1690154455002" duration="23097000" />
+      <workItem from="1690206101546" duration="85000" />
+      <workItem from="1690246169052" duration="14741000" />
+      <workItem from="1690370971331" duration="6173000" />
+      <workItem from="1690419458171" duration="18766000" />
+      <workItem from="1690458845079" duration="5169000" />
+      <workItem from="1690464119555" duration="598000" />
+      <workItem from="1690501051377" duration="18210000" />
     </task>
     <servers />
   </component>
@@ -385,6 +345,20 @@
           <line>32</line>
           <option name="timeStamp" value="19" />
         </line-breakpoint>
+        <line-breakpoint enabled="true" type="java-line">
+          <url>file://$PROJECT_DIR$/day10/src/com/lc/day10/test/ThreadStateTest.java</url>
+          <line>8</line>
+          <option name="timeStamp" value="22" />
+        </line-breakpoint>
+        <line-breakpoint enabled="true" type="java-line">
+          <url>file://$PROJECT_DIR$/day11/src/com/lc/day11/test5/CalendarTest.java</url>
+          <line>50</line>
+          <option name="timeStamp" value="23" />
+        </line-breakpoint>
+        <breakpoint enabled="true" type="java-exception">
+          <properties class="java.io.FileNotFoundException" package="java.io" />
+          <option name="timeStamp" value="20" />
+        </breakpoint>
       </breakpoints>
     </breakpoint-manager>
   </component>

+ 4 - 1
01_JavaSe/JavaSe/JavaSe.iml

@@ -2,7 +2,10 @@
 <module type="GENERAL_MODULE" version="4">
   <component name="NewModuleRootManager" inherit-compiler-output="true">
     <exclude-output />
-    <content url="file://$MODULE_DIR$" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
   </component>
 </module>

+ 38 - 0
01_JavaSe/JavaSe/day09/src/com/lc/day09/test6/ReturnExceptionDemo.java

@@ -0,0 +1,38 @@
+package com.lc.day09.test6;
+
+/**
+ * ClassName: ReturnExceptionDemo
+ * Package: com.lc.day09.test6
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/24 21:41
+ * @Version 1.0
+ */
+public class ReturnExceptionDemo {
+    static void methodA() {
+        try {
+            System.out.println("进入方法A");
+            throw new RuntimeException("制造异常");
+        }finally {
+            System.out.println("用A方法的finally");
+        }
+    }
+
+    static void methodB() {
+        try {
+            System.out.println("进入方法B");
+            return;
+        } finally {
+            System.out.println("调用B方法的finally");
+        }
+    }
+    public static void main(String[] args) {
+        try {
+            methodA();
+        } catch (Exception e) {
+            System.out.println(e.getMessage());
+        }
+        methodB();
+    }
+}

+ 29 - 0
01_JavaSe/JavaSe/day10/.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

+ 21 - 0
01_JavaSe/JavaSe/day10/day10.iml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library name="JUnit4">
+        <CLASSES>
+          <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.13.1/junit-4.13.1.jar!/" />
+          <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+  </component>
+</module>

+ 40 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/tes1/Communication.java

@@ -0,0 +1,40 @@
+package com.lc.day10.tes1;
+
+/**
+ * ClassName: Communication
+ * Package: com.lc.day10.tes1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/26 20:58
+ * @Version 1.0
+ */
+class Communication implements Runnable {
+    int i = 1;
+    public void run() {
+        while (true) {
+            synchronized (this) {
+                notify();
+                if (i <= 100) {
+                    System.out.println(Thread.currentThread().getName() + ":" + i++);
+                } else
+                    break;
+                try {
+                    wait();
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+    public static void main(String[] args) {
+        Communication communication = new Communication();
+
+        Thread thread1 = new Thread(communication);
+        Thread thread2 = new Thread(communication);
+
+        thread1.start();
+        thread2.start();
+    }
+}

+ 51 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/test/DeadLockTest.java

@@ -0,0 +1,51 @@
+package com.lc.day10.test;
+
+/**
+ * ClassName: DeadLockTest
+ * Package: com.lc.day10.test
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/26 20:43
+ * @Version 1.0
+ */
+public class DeadLockTest {
+    public static void main(String[] args) {
+
+        StringBuilder s1 = new StringBuilder("进入s1锁");
+        StringBuilder s2 = new StringBuilder("进入s2锁");
+
+        new Thread() {
+            public void run() {
+                synchronized (s1) {
+                    System.out.println(s1);
+                    try {
+                        Thread.sleep(10);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                    synchronized (s2) {
+                        System.out.println(s2);
+                    }
+                }
+            }
+        }.start();
+
+        new Thread() {
+            public void run() {
+                synchronized (s2) {
+                    System.out.println(s2);
+                    try {
+                        Thread.sleep(10);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                    synchronized (s1) {
+                        System.out.println(s1);
+                    }
+
+                }
+            }
+        }.start();
+    }
+}

+ 22 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/test/HungrySingle.java

@@ -0,0 +1,22 @@
+package com.lc.day10.test;
+
+/**
+ * ClassName: HungrySingle
+ * Package: com.lc.day10.test
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/26 20:21
+ * @Version 1.0
+ */
+public class HungrySingle {
+
+    private static HungrySingle INSTANCE = new HungrySingle();
+    //对象是否声明为final 都可以
+
+    private HungrySingle(){}
+
+    public static HungrySingle getInstance(){
+        return INSTANCE;
+    }
+}

+ 43 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/test/HungrySingleTest.java

@@ -0,0 +1,43 @@
+package com.lc.day10.test;
+
+/**
+ * ClassName: HungrySingleTest
+ * Package: com.lc.day10.test
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/26 20:21
+ * @Version 1.0
+ */
+public class HungrySingleTest {
+
+    static HungrySingle hs1 = null;
+    static HungrySingle hs2 = null;
+    public static void main(String[] args) throws InterruptedException {
+
+
+
+        Thread thread = new Thread() {
+            @Override
+            public void run() {
+                hs1 = HungrySingle.getInstance();
+            }
+        };
+
+        thread.start();
+        thread.join();
+
+        Thread thread1 = new Thread() {
+            @Override
+            public void run() {
+                hs2 = HungrySingle.getInstance();
+            }
+        };
+
+        thread1.start();
+        thread1.join();
+
+        System.out.println(hs1 == hs2);
+
+    }
+}

+ 40 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/test/LazyOne.java

@@ -0,0 +1,40 @@
+package com.lc.day10.test;
+
+/**
+ * ClassName: LazyOne
+ * Package: com.lc.day10.test
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/26 20:26
+ * @Version 1.0
+ */
+public class LazyOne {
+    private static LazyOne instance;
+
+    private LazyOne(){}
+
+    //方式1:
+    public static LazyOne getInstance1(){
+
+        if(instance == null){
+            try {
+                Thread.sleep(100);
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+            instance = new LazyOne();
+        }
+        return instance;
+    }
+
+    public static  LazyOne getInstance2(){
+        synchronized (LazyOne.class){
+            if(instance == null){
+                instance = new LazyOne();
+            }
+            return instance;
+        }
+    }
+
+}

+ 24 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/test/LazySingle.java

@@ -0,0 +1,24 @@
+package com.lc.day10.test;
+
+/**
+ * ClassName: LazySingle
+ * Package: com.lc.day10.test
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/26 20:36
+ * @Version 1.0
+ */
+public class LazySingle {
+
+    private LazySingle(){}
+
+    public static LazySingle getLazySingle(){
+        return Inner.lazySingle;
+    }
+
+    private static class Inner {
+       static LazySingle lazySingle = new LazySingle();
+    }
+
+}

+ 46 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/test/Test01.java

@@ -0,0 +1,46 @@
+package com.lc.day10.test;
+
+import org.junit.Test;
+
+/**
+ * ClassName: Test01
+ * Package: com.lc.day10.test
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/26 20:30
+ * @Version 1.0
+ */
+public class Test01 {
+
+    static LazyOne s1;
+    static LazyOne s2;
+
+    public static void main(String[] args) {
+
+        Thread t1 = new Thread(){
+            public void run(){
+                s1 = LazyOne.getInstance1();
+            }
+        };
+        Thread t2 = new Thread(){
+            public void run(){
+                s2 = LazyOne.getInstance1();
+            }
+        };
+
+        t1.start();
+        t2.start();
+
+        try {
+            t1.join();
+            t2.join();
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+
+        System.out.println(s1);
+        System.out.println(s2);
+        System.out.println(s1 == s2);
+    }
+}

+ 36 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/test/ThreadStateTest.java

@@ -0,0 +1,36 @@
+package com.lc.day10.test;
+
+/**
+ * @author 陈晨
+ * @create 22:15
+ */
+public class ThreadStateTest {
+    public static void main(String[] args) throws InterruptedException {
+        SubThread t = new SubThread();
+        System.out.println(t.getName() + " 状态 " + t.getState());
+        t.start();
+
+        while (Thread.State.TERMINATED != t.getState()) {
+            System.out.println(t.getName() + " 状态 " + t.getState());
+            Thread.sleep(500);
+        }
+        System.out.println(t.getName() + " 状态 " + t.getState());
+    }
+}
+
+class SubThread extends Thread {
+    @Override
+    public void run() {
+        while (true) {
+            for (int i = 0; i < 3; i++) {
+                System.out.println("打印:" + i);
+                try {
+                    Thread.sleep(1000);
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                }
+            }
+            break;
+        }
+    }
+}

+ 41 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/test/Ticket.java

@@ -0,0 +1,41 @@
+package com.lc.day10.test;
+
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * ClassName: Ticket
+ * Package: com.lc.day10.test
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/26 19:57
+ * @Version 1.0
+ */
+public class Ticket {
+
+
+    int ticket = 100;
+
+    ReentrantLock lock = new ReentrantLock();
+
+    public void sale(){
+
+        if (ticket > 0){
+
+            try {
+                Thread.sleep(10);
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+
+            String s = Thread.currentThread().getName() + "卖出" + ticket;
+            System.out.println(s);
+            ticket--;
+
+        }else {
+            throw new RuntimeException("mle");
+        }
+
+
+    }
+}

+ 52 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/test/TicketRujable.java

@@ -0,0 +1,52 @@
+package com.lc.day10.test;
+
+import java.awt.*;
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * ClassName: TicketRujable
+ * Package: com.lc.day10.test
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/26 20:51
+ * @Version 1.0
+ */
+public class TicketRujable implements Runnable{
+
+    private final static ReentrantLock lock = new ReentrantLock();
+    int ticket = 100;
+    @Override
+    public void run() {
+
+        while (true){
+            try {
+                lock.lock();
+                if(ticket > 0){
+                    try {
+                        Thread.sleep(10);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                    System.out.println(ticket--);
+                }else{
+                    break;
+                }
+            } finally {
+                lock.unlock();
+            }
+        }
+    }
+
+    public static void main(String[] args) {
+
+        TicketRujable ticketRujable = new TicketRujable();
+
+        Thread t1 = new Thread(ticketRujable);
+        Thread t2 = new Thread(ticketRujable);
+
+        t1.start();
+        t2.start();
+
+    }
+}

+ 41 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test01.java

@@ -0,0 +1,41 @@
+package com.lc.day10.thowable1;
+
+import org.junit.Test;
+
+/**
+ * ClassName: Test01
+ * Package: com.lc.day10.thowable1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/25 9:31
+ * @Version 1.0
+ */
+public class Test01 {
+
+    @Test
+    public void test01(){
+        //数组越界
+        forArr( new int[1] );
+        //执行
+        System.out.println("执行");
+    }
+
+    public void forArr( int[] arr){
+        //获取不存在的地址
+        System.out.println(arr[10]);
+    }
+
+
+    public static void main(String[] args) {
+        int[] arr = new int[2];
+
+        System.out.println(arr[10]);
+
+
+        //下面的代码
+
+        System.out.println("执行");
+    }
+
+}

+ 35 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test02.java

@@ -0,0 +1,35 @@
+package com.lc.day10.thowable1;
+
+import org.junit.Test;
+
+/**
+ * ClassName: Test01
+ * Package: com.lc.day10.thowable1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/25 9:31
+ * @Version 1.0
+ */
+public class Test02 {
+
+    @Test
+    public void test01(){
+        //栈 溢出
+        a();
+    }
+
+    public void  a(){
+        a();
+        //java.lang.StackOverflowError
+    }
+
+    @Test
+    public void test02(){
+        //堆溢出
+        Object[] arr  = new Object[Integer.MAX_VALUE];
+        //java.lang.OutOfMemoryError:
+    }
+
+
+}

+ 27 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test03.java

@@ -0,0 +1,27 @@
+package com.lc.day10.thowable1;
+
+import org.junit.Test;
+
+/**
+ * ClassName: Test03
+ * Package: com.lc.day10.thowable1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/25 10:12
+ * @Version 1.0
+ */
+public class Test03 {
+
+    @Test
+    public void test03(){
+        //OutOfMemoryError
+        //方式二:
+        StringBuilder s = new StringBuilder(); // 字符串
+        while(true){
+            s.append("lc"); //添加
+
+            //new 堆  字符串 占用字节
+        }
+    }
+}

+ 65 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test04.java

@@ -0,0 +1,65 @@
+package com.lc.day10.thowable1;
+
+import org.junit.Test;
+
+import java.util.Scanner;
+
+/**
+ * ClassName: Test04
+ * Package: com.lc.day10.thowable1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/25 10:14
+ * @Version 1.0
+ */
+public class Test04 {
+    @Test
+    public void test01(){
+        //NullPointerException
+        int[][] arr = new int[3][];
+        //通过null对象 调用属性方法
+        System.out.println(arr[0].length);
+    }
+
+    @Test
+    public void test02(){
+        //ClassCastException  类型转换异常
+        Object obj = 15;
+        String str = (String) obj;
+
+        //狗 猫
+    }
+
+    @Test
+    public void test03(){
+        //ArrayIndexOutOfBoundsException  数组越界
+        int[] arr = new int[5];  // 5个元素  索引为5  最大索引是4
+        for (int i = 1; i <= 5; i++) {
+            System.out.println(arr[i]);
+        }
+    }
+
+    public static void main(String[] args) {
+        test04();
+    }
+
+    public static void test04(){
+        //InputMismatchException 输入异常
+        Scanner input = new Scanner(System.in);
+        System.out.print("请输入一个整数:");//输入非整数
+        int num = input.nextInt();
+        input.close();
+    }
+
+    @Test
+    public void test05(){
+        int a = 1;
+        int b = 0; //除数不能为 0
+        //ArithmeticException  算数异常
+        System.out.println(a/b);
+    }
+
+    //说几个常见的异常
+
+}

+ 79 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test05.java

@@ -0,0 +1,79 @@
+package com.lc.day10.thowable1;
+
+import org.junit.Test;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.Scanner;
+
+/**
+ * ClassName: Test04
+ * Package: com.lc.day10.thowable1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/25 10:14
+ * @Version 1.0
+ */
+public class Test05 {
+    //异常处理 两种方法
+    @Test
+    public void test06() {
+        // 编译
+        // 提示
+        try {
+            //线程
+            Thread.sleep(5000);//休眠1秒  InterruptedException 中断异常
+
+            System.out.println("hello");
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    @Test
+    public void test07(){
+        try {
+            Class c = Class.forName("java.xxx.String");//ClassNotFoundException
+        } catch (ClassNotFoundException e) {
+           // throw new RuntimeException(e); //异常信息注释
+            e.printStackTrace();
+        }
+        System.out.println("hello");
+    }
+
+    @Test
+    public void test08() throws SQLException {
+        Connection conn = DriverManager.getConnection("....");  //SQLException
+    }
+    @Test
+    public void test09() throws FileNotFoundException {
+        FileInputStream fis = new FileInputStream("陈哥Java秘籍.txt");
+        //FileNotFoundException
+    }
+    @Test
+    public void test10() {
+        try {
+            File file = new File("陈哥Java秘籍.txt");
+            FileInputStream fis = new FileInputStream(file);//FileNotFoundException
+            int b = fis.read();//IOException
+            while(b != -1){
+                System.out.print((char)b);
+                b = fis.read();//IOException
+            }
+
+            fis.close();//IOException
+        } catch (FileNotFoundException e) {
+            throw new RuntimeException(e);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+    //说几个常见的异常  
+
+}

+ 89 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test06_try.java

@@ -0,0 +1,89 @@
+package com.lc.day10.thowable1;
+
+import org.junit.Test;
+
+import java.util.Scanner;
+
+/**
+ * ClassName: Test06_try
+ * Package: com.lc.day10.thowable1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/25 10:37
+ * @Version 1.0
+ */
+public class Test06_try {
+
+    @Test
+    public void test01(){
+
+
+
+        try {
+
+            //数组越界
+            int[] arr = new int[2];
+
+            System.out.println("索引:"+arr[3]);
+
+            //算数
+            //int c = 1/0;
+
+            Object a = "a";
+            //int b = (int) a;
+
+        }catch ( ArrayIndexOutOfBoundsException e ){
+            //自定义 处理
+            // System.out.println("数组越界");
+            System.out.println(e.getMessage());
+            // 详细信息 ****
+            e.printStackTrace();
+        }catch ( ArithmeticException e ){
+            e.printStackTrace();
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+
+
+        System.out.println("success");
+    }
+
+
+    public static void main(String[] args) {
+        test02();
+    }
+
+    public static void test02(){
+        //输入对象
+        Scanner sc = new Scanner(System.in);
+
+        try {
+            System.out.println("请输入 整数");
+            int i = sc.nextInt();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }finally {
+            //关闭
+            sc.close();
+            System.out.println("关闭");
+        }
+    }
+
+    @Test
+    public void test03(){
+        int test = test("a");
+        System.out.println(test); //结果
+    }
+
+    public static int test(String str){
+        try{
+            Integer.parseInt(str);
+            return 1;
+        }catch(NumberFormatException e){
+            return -1;
+        }finally{
+            System.out.println("test结束");
+        }
+    }
+}

+ 55 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test07_try.java

@@ -0,0 +1,55 @@
+package com.lc.day10.thowable1;
+
+import org.junit.Test;
+
+import java.util.Scanner;
+
+/**
+ * ClassName: Test06_try
+ * Package: com.lc.day10.thowable1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/25 10:37
+ * @Version 1.0
+ */
+public class Test07_try {
+
+
+
+    @Test
+    public void test03(){
+        int test = test("a");
+        System.out.println(test); //结果
+    }
+
+    public static int test(String str){
+        try{
+            Integer.parseInt(str);
+            return 1;
+        }catch(NumberFormatException e){
+            return -1; //不会立即返回  有finally 里面的代码 return 0;
+        }finally{
+            System.out.println("test结束");
+            return 0;
+        }
+    }
+
+    public static void main(String[] args) {
+        int result = test();
+        System.out.println(result); //
+    }
+
+    public static int test(){
+        int i = 100;
+        try {
+            return i; //记录返回值
+        } finally {
+            i++; //i ++  101
+            System.out.println(i);  //执行完 返回 之前记录的值。
+        }
+        //不会立即返回  有finally  return 记录返回值  100 进行  i++ 返回 100 ;
+
+    }
+
+}

+ 53 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test08_throws.java

@@ -0,0 +1,53 @@
+package com.lc.day10.thowable1;
+
+import org.junit.Test;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+
+/**
+ * ClassName: Test06_try
+ * Package: com.lc.day10.thowable1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/25 10:37
+ * @Version 1.0
+ */
+public class Test08_throws {
+
+    @Test
+    public void test01(){
+        try {
+            m1();
+        } catch (Exception e) {
+           e.printStackTrace();
+        }
+        System.out.println("test");
+    }
+
+
+    public void m1() throws Exception{
+        m2();
+    }
+
+    public void m2() throws Exception { //可以 当前异常 父类异常
+        //处理 加 try catch
+        /*  try {
+            m3();
+        } catch (FileNotFoundException e) {
+            throw new RuntimeException(e);
+        }*/
+
+        //不处理 抛出
+        m3();
+    }
+    //不处理 抛出
+    public void m3() throws FileNotFoundException {
+        FileInputStream fis = new FileInputStream("a.txt");
+    }
+
+
+
+
+}

+ 33 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test09_method_throws.java

@@ -0,0 +1,33 @@
+package com.lc.day10.thowable1;
+
+import org.junit.Test;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+
+/**
+ * ClassName: Test06_try
+ * Package: com.lc.day10.thowable1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/25 10:37
+ * @Version 1.0
+ */
+public class Test09_method_throws {
+
+}
+class A {
+
+    public void m() throws ArithmeticException {
+
+    }
+}
+
+class B extends A {
+    //父类没有 不能有
+    // 子类不能抛出比父类更大的异常
+    public void m() throws ArithmeticException {
+
+    }
+}

+ 78 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/Test10_throws.java

@@ -0,0 +1,78 @@
+package com.lc.day10.thowable1;
+
+import org.junit.Test;
+
+import java.util.Scanner;
+
+/**
+ * ClassName: Test06_try
+ * Package: com.lc.day10.thowable1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/25 10:37
+ * @Version 1.0
+ */
+public class Test10_throws {
+    //参数异常
+
+    @Test
+    public void test02() {
+        Scanner scanner = new Scanner(System.in);
+
+        scanner.close();
+    }
+
+    @Test
+    public void test01() {
+        try {
+            int max = max1();
+            System.out.println(max);
+        } catch (IllegalAccessException e) {
+            throw new RuntimeException(e);
+            //System.out.println("123");
+        }
+    }
+
+    public int  max1( int ... a ) throws IllegalAccessException {
+
+        int max = 0;
+        //健壮性
+        if ( a == null || a.length == 0 ){
+            //message 提示信息
+            throw new IllegalAccessException("长度不能为0,也不能是null对象");
+        }
+        for (int i = 0; i < a.length; i++) {
+            if ( a[i] > max  ){
+                max = a[i];
+            }
+        }
+
+        return max;
+    }
+
+    //比较大小
+    public int  max( int ... a ){
+
+        int max = 0;
+        try {
+            //健壮性
+            if ( a == null || a.length == 0 ){
+                //message 提示信息
+                throw new IllegalAccessException("长度不能为0,也不能是null对象");
+            }
+
+            for (int i = 0; i < a.length; i++) {
+                if ( a[i] > max  ){
+                    max = a[i];
+                }
+            }
+
+        } catch (IllegalAccessException e) {
+            e.printStackTrace();
+        }
+        return max;
+    }
+
+
+}

+ 29 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/ex/MyException.java

@@ -0,0 +1,29 @@
+package com.lc.day10.thowable1.ex;
+
+/**
+ * ClassName: MyException
+ * Package: com.lc.day10.thowable1.ex
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/25 14:30
+ * @Version 1.0
+ */
+public class MyException  extends RuntimeException {
+    //唯一标识
+    Long serialVersionUID = 123123123124124312L;
+
+    String code;
+
+    public MyException() {
+    }
+
+    public MyException(String code, String message ) {
+        super(message);
+        this.code = code;
+    }
+
+    public MyException(String message) {
+        super(message);
+    }
+}

+ 27 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/ex/TestMyException.java

@@ -0,0 +1,27 @@
+package com.lc.day10.thowable1.ex;
+
+import org.junit.Test;
+
+/**
+ * ClassName: MyException
+ * Package: com.lc.day10.thowable1.ex
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/25 14:30
+ * @Version 1.0
+ */
+public class TestMyException  {
+
+    @Test
+    public void test(){
+
+        try {
+            throw new MyException( "1234","超过时间不允许退号");
+            //现在jvm
+            //之后自行捕捉 异常信息
+        } catch (MyException e) {
+            System.out.println(e.code);
+        }
+    }
+}

+ 33 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/exer1/PersonNumberException.java

@@ -0,0 +1,33 @@
+package com.lc.day10.thowable1.exer1;
+
+/**
+ * ClassName: PersonNumberException
+ * Package: com.lc.day10.thowable1.exer1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/25 14:39
+ * @Version 1.0
+ */
+public class PersonNumberException extends Exception {
+
+    //UID
+    public Long serialVersionUID = 123L;
+
+    //code
+    public String code;
+    //构造
+
+    public PersonNumberException(String message, String code) {
+        super(message);
+        this.code = code;
+    }
+
+    public PersonNumberException(String message) {
+        super(message);
+    }
+
+    public PersonNumberException() {
+    }
+
+}

+ 42 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/exer1/Register.java

@@ -0,0 +1,42 @@
+package com.lc.day10.thowable1.exer1;
+
+/**
+ * ClassName: Register
+ * Package: com.lc.day10.thowable1.exer1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/25 14:42
+ * @Version 1.0
+ */
+public class Register {
+
+    public static void main(String[] args) {
+        //调用者
+        int register = register(-1);
+
+        if (register == 200){
+            System.out.println("成功");
+        }else{
+            System.out.println("失败");
+        }
+
+    }
+
+    public static int register(int num )  {
+
+        try {
+            if (num < 0 ){
+                throw new PersonNumberException("人数不能是负数","500");
+            }else {
+                System.out.println("注册成功"+num);
+            }
+            return 200;
+        } catch (PersonNumberException e) {
+            e.printStackTrace();
+            //失败的code码
+            return Integer.parseInt(e.code);
+        }
+    }
+
+}

+ 22 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/exer2/NotTriangleException.java

@@ -0,0 +1,22 @@
+package com.lc.day10.thowable1.exer2;
+
+/**
+ * ClassName: NotTriangleException
+ * Package: com.lc.day10.thowable1.exer2
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/25 15:24
+ * @Version 1.0
+ */
+public class NotTriangleException extends RuntimeException {
+
+    private Long serialVersionUID = 123L;
+
+    public NotTriangleException(String message) {
+        super(message);
+    }
+
+    public NotTriangleException() {
+    }
+}

+ 30 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/exer2/TestTriangle.java

@@ -0,0 +1,30 @@
+package com.lc.day10.thowable1.exer2;
+
+/**
+ * ClassName: Triangle
+ * Package: com.lc.day10.thowable1.exer2
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/25 15:25
+ * @Version 1.0
+ */
+public class TestTriangle {
+
+    public static void main(String[] args) {
+
+        Triangle triangle = new Triangle(10, 10, 10);
+        System.out.println(triangle);
+
+        try {
+            Triangle triangle1 = new Triangle(-1, 10, 10);
+            System.out.println(triangle1);
+        } catch (Exception e) {
+            //e.printStackTrace();
+        }
+
+        Triangle triangle1 = new Triangle(1, 10, 20);
+        System.out.println(triangle1);
+
+    }
+}

+ 42 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/exer2/Triangle.java

@@ -0,0 +1,42 @@
+package com.lc.day10.thowable1.exer2;
+
+/**
+ * ClassName: Triangle
+ * Package: com.lc.day10.thowable1.exer2
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/25 15:25
+ * @Version 1.0
+ */
+public class Triangle {
+
+    private Integer a;
+    private Integer b;
+    private Integer c;
+
+    public Triangle(Integer a, Integer b, Integer c) {
+
+        if (a < 0 || b < 0 || c < 0){
+            throw new NotTriangleException("边长不能小于0");
+        }
+
+        if (a + b <= c || a + c <= b || c + b <= a){
+            throw new NotTriangleException("两边之和必须大于第三边");
+        }
+
+        this.a = a;
+        this.b = b;
+        this.c = c;
+    }
+
+
+    @Override
+    public String toString() {
+        return "Triangle{" +
+                "a=" + a +
+                ", b=" + b +
+                ", c=" + c +
+                '}';
+    }
+}

+ 39 - 0
01_JavaSe/JavaSe/day10/src/com/lc/day10/thowable1/exer3/ReturnExceptionDemo.java

@@ -0,0 +1,39 @@
+package com.lc.day10.thowable1.exer3;
+
+/**
+ * ClassName: ReturnExceptionDemo
+ * Package: com.lc.day10.thowable1.exer3
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/25 15:36
+ * @Version 1.0
+ */
+public class ReturnExceptionDemo {
+    static void methodA() {
+        try {
+            System.out.println("1");
+            throw new RuntimeException("2");
+        }finally {
+            System.out.println("3");
+        }
+    }
+    static void methodB() {
+        try {
+            System.out.println("4");
+            return;
+        } finally {
+            System.out.println("5");
+        }
+    }
+    public static void main(String[] args) {
+//        try {
+//            methodA();
+//        } catch (Exception e) {
+//            System.out.println(e.getMessage());
+//        }
+//        methodA();
+
+        methodB();
+    }
+}

+ 29 - 0
01_JavaSe/JavaSe/day11/.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

+ 11 - 0
01_JavaSe/JavaSe/day11/day11.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>

+ 55 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/exer/exer1/Test01.java

@@ -0,0 +1,55 @@
+package com.lc.day11.exer.exer1;
+
+/**
+ * ClassName: Test01
+ * Package: com.lc.day11.exer.exer1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 10:33
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) {
+
+        new Thread(){
+            @Override
+            public void run() {
+                for (int i = 0; i < 100 ; i++) {
+                    if ( i % 2 == 1  ){
+                        System.out.println(i+"---"+Thread.currentThread().getName());
+                    }
+                }
+            }
+        }.start();
+
+//        new Thread(
+//            new Runnable() {
+//                @Override
+//                public void run() {
+//                    for (int i = 0; i < 100 ; i++) {
+//                        if ( i % 2 == 0  ){
+//                            System.out.println(i+"---"+Thread.currentThread().getName());
+//                        }
+//                    }
+//                }
+//            }
+//        ).start();
+
+        //方式3  lambda
+        new Thread(
+            () -> {
+                for (int i = 0; i < 100 ; i++) {
+                    if ( i % 2 == 0  ){
+                        System.out.println(i+"---"+Thread.currentThread().getName());
+                    }
+                }
+            }
+        ).start();
+
+
+
+    }
+
+}

+ 39 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/exer/exer1/Test02.java

@@ -0,0 +1,39 @@
+package com.lc.day11.exer.exer1;
+
+/**
+ * ClassName: Test01
+ * Package: com.lc.day11.exer.exer1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 10:33
+ * @Version 1.0
+ */
+public class Test02 {
+
+    public static void main(String[] args) {
+
+        new Thread(){
+            @Override
+            public void run() {
+                //取线程名称和优先级。设置该线程优先级为最高优先级并启动该线程。
+                Thread thread1 = Thread.currentThread();
+                //线程名称
+                System.out.println(thread1.getName());
+                //优先级
+                int priority = thread1.getPriority();
+                System.out.println(priority);
+                //设置 最大
+                thread1.setPriority(Thread.MAX_PRIORITY);
+            }
+        }.start();
+
+        //当前线程
+        Thread thread = Thread.currentThread();
+        //获取优先级
+        System.out.print(thread.getPriority()+"---");
+        System.out.println(thread.getName());
+
+    }
+
+}

+ 65 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/exer/exer1/Test03.java

@@ -0,0 +1,65 @@
+package com.lc.day11.exer.exer1;
+
+/**
+ * ClassName: Test01
+ * Package: com.lc.day11.exer.exer1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 10:33
+ * @Version 1.0
+ */
+public class Test03 {
+
+    public static void main(String[] args) {
+        //声明一个匿名内部类继承Thread类,重写run方法,实现打印[1,100]之间的偶数,要求每隔1秒打印1个偶数。
+        Thread thread = new Thread(){
+            @Override
+            public void run() {
+                for (int i = 0; i < 100 ; i++) {
+                    if (i % 2 == 0){
+//                        try {
+//                            Thread.sleep(10); //暂停十毫秒
+//                        } catch (InterruptedException e) {
+//                            throw new RuntimeException(e);
+//                        }
+                        System.out.println(Thread.currentThread().getName()+"--"+i);
+                    }
+                }
+            }
+        };
+        //抢占cpu执行权
+        thread.start();
+
+        //声明一个匿名内部类继承Thread类,重写run方法,实现打印[1,100]之间的奇数,
+        //- 当打印到5时,让奇数线程暂停一下,再继续。
+        //- 当打印到5时,让奇数线程停下来,让偶数线程执行完再打印。
+        new Thread(){
+            @Override
+            public void run() {
+                for (int i = 0; i < 100 ; i++) {
+
+//                    if (i == 5){
+//                        //获取线程
+//                        //Thread thread = Thread.currentThread();
+//                        //可以没有提示  暂停 让其他线程执行 谦让
+//                        //thread.yield();
+//                        this.yield(); // 偶数执行  有执行权 继续执行
+//                    }
+
+                    if ( i == 5){
+                        try {
+                            thread.join(); //插队
+                        } catch (InterruptedException e) {
+                            throw new RuntimeException(e);
+                        }
+                    }
+
+                    if (i % 2 != 0){
+                        System.out.println(Thread.currentThread().getName()+"--"+i);
+                    }
+                }
+            }
+        }.start();
+    }
+}

+ 43 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/exer/exer1/Test04.java

@@ -0,0 +1,43 @@
+package com.lc.day11.exer.exer1;
+
+/**
+ * ClassName: Test01
+ * Package: com.lc.day11.exer.exer1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 10:33
+ * @Version 1.0
+ */
+public class Test04 {
+
+    public static void main(String[] args) {
+        //setDaemon 设置守护线程
+
+        //守护水晶   守护非守护线程。
+
+        //守护  象棋 车  马  炮  小兵
+        //非守护线程  将
+
+        MyDaemon myDaemon = new MyDaemon();
+        Thread thread = new Thread(myDaemon);
+        //设置守护线程
+        thread.setDaemon(true);
+        //开启
+        thread.start();
+        //主线程 非守护线程
+        for (int i = 0; i < 100 ; i++) {
+            System.out.println(i+"--"+Thread.currentThread().getName());
+        }
+
+    }
+}
+class MyDaemon implements Runnable{
+
+    @Override
+    public void run() {
+        while (true){
+            System.out.println("一直守护");
+        }
+    }
+}

+ 37 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/test/TicketRunnable.java

@@ -0,0 +1,37 @@
+package com.lc.day11.test;
+
+/**
+ * ClassName: A
+ * Package: com.lc.day11.test
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 16:12
+ * @Version 1.0
+ */
+
+public class TicketRunnable implements Runnable {
+    static int ticket=100;
+
+    //线程1 100  线程1 100  线程1 100
+    public synchronized void sale(){
+        if(ticket>0){
+            System.out.println(Thread.currentThread().getName()+"正在卖"+ticket);
+            ticket--;
+        }
+    }
+    @Override
+    public void run() {
+
+        while (ticket>0) {
+            try {
+                //线程1 100  线程1 100  线程1 100
+                Thread.currentThread().sleep(0); // 线程1 80
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+            System.out.println(Thread.currentThread().getName()+"在卖"+ticket);
+            ticket--;
+        }
+    }
+}

+ 21 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/test/TicketTest.java

@@ -0,0 +1,21 @@
+package com.lc.day11.test;
+
+/**
+ * ClassName: A
+ * Package: com.lc.day11.test
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 16:12
+ * @Version 1.0
+ */
+
+public class TicketTest  {
+    public static void main(String[] args) {
+        TicketRunnable ticketRunnable = new TicketRunnable();
+
+        new Thread(ticketRunnable).start();
+        new Thread(ticketRunnable).start();
+        new Thread(ticketRunnable).start();
+    }
+}

+ 23 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/test1/Test.java

@@ -0,0 +1,23 @@
+package com.lc.day11.test1;
+
+/**
+ * ClassName: B
+ * Package: com.lc.day11.test1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 16:59
+ * @Version 1.0
+ */
+
+public class Test {
+    public static void main(String[] args) {
+        TicketRunnable ticketRunnable = new TicketRunnable();
+        Thread thread1 = new Thread(ticketRunnable, "线程一");
+        Thread thread2 = new Thread(ticketRunnable, "线程二");
+        Thread thread3 = new Thread(ticketRunnable, "线程三");
+        thread1.start();
+        thread2.start();
+        thread3.start();
+    }
+}

+ 31 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/test1/TicketRunnable.java

@@ -0,0 +1,31 @@
+package com.lc.day11.test1;
+
+/**
+ * ClassName: A
+ * Package: com.lc.day11.test1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 16:59
+ * @Version 1.0
+ */
+public class TicketRunnable implements Runnable {
+
+    static int ticket=100;
+
+    @Override
+    public void run() {
+
+        try {
+            //线程1 100  线程2 100  线程3 100
+            Thread.currentThread().sleep(10);
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        }
+
+        while (ticket>0) {
+            System.out.println(Thread.currentThread().getName()+"在卖"+ticket);
+            ticket--;
+        }
+    }
+}

+ 43 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/test2/Communction.java

@@ -0,0 +1,43 @@
+package com.lc.day11.test2;
+
+/**
+ * ClassName: Communction
+ * Package: com.lc.day11.test2
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 20:05
+ * @Version 1.0
+ */
+public class Communction implements  Runnable{
+
+    int a = 0;
+    @Override
+    public void run() {
+
+        while (true){
+
+            synchronized (this){
+                notify();
+                if (a <= 100){
+                    System.out.println(Thread.currentThread().getName()+"--"+a);
+                    a++;
+                }else {
+                    break;
+                }
+                try {
+                    wait();
+                } catch (InterruptedException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        }
+    }
+
+
+    public static void main(String[] args) {
+        Communction communction = new Communction();
+        new Thread(communction).start();
+        new Thread(communction).start();
+    }
+}

+ 43 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/test2/Communction1.java

@@ -0,0 +1,43 @@
+package com.lc.day11.test2;
+
+/**
+ * ClassName: Communction
+ * Package: com.lc.day11.test2
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 20:05
+ * @Version 1.0
+ */
+public class Communction1 implements  Runnable{
+
+    int a = 0;
+    @Override
+    public void run() {
+
+        while (true){
+
+            synchronized (this){
+                notify();
+                if (a <= 100){
+                    System.out.println(Thread.currentThread().getName()+"--"+a);
+                    a++;
+                }else {
+                    break;
+                }
+                try {
+                    wait();
+                } catch (InterruptedException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        }
+    }
+
+
+    public static void main(String[] args) {
+        Communction1 communction = new Communction1();
+        new Thread(communction).start();
+        new Thread(communction).start();
+    }
+}

+ 122 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/test2/ConsumerProducerTest.java

@@ -0,0 +1,122 @@
+package com.lc.day11.test2;
+
+/**
+ * ClassName: ConsumerProducerTest
+ * Package: com.lc.day11.test2
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 20:41
+ * @Version 1.0
+ */
+public class ConsumerProducerTest {
+    public static void main(String[] args) {
+        Product product = new Product();
+        Producer p1 = new Producer(product);
+
+       Consumer c1 = new Consumer(product);
+        Consumer c2 = new Consumer(product);
+
+        p1.setName("生产者1");
+        c1.setName("消费者1");
+        c2.setName("消费者2");
+
+        p1.start();
+        c1.start();
+        c2.start();
+    }
+}
+
+//生产者
+class Producer extends Thread{
+    private Product product;
+
+    public Producer(Product product){
+        this.product = product;
+    }
+
+    @Override
+    public void run() {
+
+        System.out.println("=========生产者开始生产产品========");
+        while(true){
+
+            try {
+                Thread.sleep(40);
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+
+            //要求Product去增加产品
+            product.addProduct();
+        }
+    }
+}
+
+//消费者
+class Consumer extends Thread{
+    private Product product;
+
+    public Consumer(Product product){
+        this.product = product;
+    }
+    @Override
+    public void run() {
+        System.out.println("=========消费者开始消费产品========");
+        while(true){
+
+            try {
+                Thread.sleep(90);
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+
+            //要求Product去减少产品
+            product.minusProduct();
+        }
+    }
+}
+
+//资源类
+class Product {
+    private int productNum = 0;//产品数量
+    private static final int MAX_PRODUCT = 20;
+    private static final int MIN_PRODUCT = 1;
+
+    //增加产品
+    public synchronized void addProduct() {
+        if(productNum < MAX_PRODUCT){
+            productNum++;
+            System.out.println(Thread.currentThread().getName() +
+                    "生产了第" + productNum + "个产品");
+            //唤醒消费者
+            this.notifyAll();
+        }else{
+
+            try {
+                this.wait();
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    //减少产品
+    public synchronized void minusProduct() {
+        if(productNum >= MIN_PRODUCT){
+            System.out.println(Thread.currentThread().getName() +
+                    "消费了第" + productNum + "个产品");
+            productNum--;
+
+            //唤醒生产者
+            this.notifyAll();
+        }else{
+            try {
+                this.wait();
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+}

+ 31 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/test3/Consumer.java

@@ -0,0 +1,31 @@
+package com.lc.day11.test3;
+
+/**
+ * ClassName: Producer
+ * Package: com.lc.day11.test2
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 20:29
+ * @Version 1.0
+ */
+public class Consumer implements Runnable{
+
+    Product product;
+
+    public Consumer(Product product){
+        this.product = product;
+    }
+
+    @Override
+    public void run() {
+        while (true){
+            try {
+                Thread.sleep(40);
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+            product.sub();
+        }
+    }
+}

+ 31 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/test3/Producer.java

@@ -0,0 +1,31 @@
+package com.lc.day11.test3;
+
+/**
+ * ClassName: Producer
+ * Package: com.lc.day11.test2
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 20:29
+ * @Version 1.0
+ */
+public class Producer implements Runnable{
+
+    Product product;
+
+    public Producer( Product product){
+        this.product = product;
+    }
+
+    @Override
+    public void run() {
+        while (true){
+            try {
+                Thread.sleep(40);
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+            product.add();
+        }
+    }
+}

+ 51 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/test3/Product.java

@@ -0,0 +1,51 @@
+package com.lc.day11.test3;
+
+/**
+ * ClassName: Product
+ * Package: com.lc.day11.test2
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 20:29
+ * @Version 1.0
+ */
+public class Product {
+
+    int a = 0;
+
+    public static final int MAX = 20;
+    public static final int MIN = 1;
+
+    public synchronized void add(){
+        while ( a < MAX ){
+            System.out.println(Thread.currentThread().getName()+"---"+(a++));
+
+            //唤醒
+            this.notifyAll();
+        }
+            try {
+                wait();
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+
+
+    }
+
+    public synchronized void sub(){
+        while ( a > MIN ){
+            System.out.println(Thread.currentThread().getName()+"---"+(a--));
+
+            //唤醒
+            this.notifyAll();
+        }
+            try {
+                wait();
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+
+
+    }
+
+}

+ 25 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/test3/Test.java

@@ -0,0 +1,25 @@
+package com.lc.day11.test3;
+
+/**
+ * ClassName: Test
+ * Package: com.lc.day11.test2
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 20:36
+ * @Version 1.0
+ */
+public class Test {
+
+    public static void main(String[] args) {
+
+        Product product = new Product();
+
+        Thread thread = new Thread(new Producer(product));
+        thread.setName("生产");
+        thread.start();
+        new Thread( new Producer(product) ).start();
+        new Thread( new Consumer(product) ).start();
+
+    }
+}

+ 34 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/test4/CallableTest.java

@@ -0,0 +1,34 @@
+package com.lc.day11.test4;
+
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.FutureTask;
+
+/**
+ * ClassName: CallableTest
+ * Package: com.lc.day11.test4
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 20:55
+ * @Version 1.0
+ */
+public class CallableTest {
+    public static void main(String[] args) throws ExecutionException, InterruptedException {
+
+       NumThread numThread = new NumThread();
+
+
+       FutureTask futureTask = new FutureTask(numThread);
+
+        Thread thread = new Thread(futureTask);
+
+        thread.start();
+
+
+        Object o = futureTask.get();
+
+        System.out.println(o);
+
+
+    }
+}

+ 27 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/test4/NumThread.java

@@ -0,0 +1,27 @@
+package com.lc.day11.test4;
+
+import java.util.concurrent.Callable;
+
+/**
+ * ClassName: NumThread
+ * Package: com.lc.day11.test4
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 20:55
+ * @Version 1.0
+ */
+public class NumThread implements Callable {
+    @Override
+    public Object call() throws Exception {
+
+        int sum = 0;
+        for (int i = 1; i <= 100; i++) {
+            if (i % 2 == 0) {
+                System.out.println(i);
+                sum += i;
+            }
+        }
+        return sum;
+    }
+}

+ 81 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/test5/CalendarTest.java

@@ -0,0 +1,81 @@
+package com.lc.day11.test5;
+
+import java.util.Calendar;
+import java.util.Scanner;
+
+/**
+ * ClassName: CalendarTest
+ * Package: com.lc.day11.test5
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/28 8:10
+ * @Version 1.0
+ */
+public class CalendarTest {
+    private static Scanner scanner = new Scanner(System.in);
+    private static int year;
+    private static int month;
+    private static final int[] MONTHS =
+            {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};//月份天数数组
+
+    public static void main(String[] args) {
+        getValue();
+        showCalendar(year, month);
+    }
+
+    private static void getValue() {
+        System.out.print("请输入年份:");
+        year = scanner.nextInt();
+        while (year > 3000 || year < 1900) {
+            System.out.println("年份有误,请重新输入:");
+            year = scanner.nextInt();
+        }
+        if (isLeap(year)) {//是闰年2月变为29天
+            MONTHS[1] = 29;
+        }
+        System.out.print("请输入月份:");
+        month = scanner.nextInt();
+        while (month > 12 || year < 0) {
+            System.out.println("月份有误,请重新输入:");
+            year = scanner.nextInt();
+        }
+        scanner.close();
+    }
+
+    private static void showCalendar(int year, int month) {
+        int count = 0;//计数器,用于记录每行数据个数
+        int monthIndex = month - 1;//真实月份-1得下标
+        System.out.println("日" + "\t" + "一" + "\t" + "二" + "\t" + "三" + "\t" +
+                "四" + "\t" + "五" + "\t" + "六" + "\t");
+        Calendar calendar = Calendar.getInstance();
+        calendar.set(Calendar.YEAR, year);//设置年
+        calendar.set(Calendar.MONTH, monthIndex);//设置月
+        calendar.set(Calendar.DAY_OF_MONTH, 1);//设置为月份的1号
+        int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+        //1号为星期几,注意星期日是1,星期六是7
+        for (int i = 0; i < dayOfWeek - 1; i++) {//打印第一行
+            System.out.print("\t");
+            count++;
+        }
+        for (int i = 1; i <= MONTHS[monthIndex]; i++) {
+            System.out.print(i);
+            count++;
+            if (count == 7) {//满7换行
+                System.out.println();
+                count = 0;
+                continue;
+            }
+            System.out.print("\t");
+        }
+    }
+
+    private static boolean isLeap(int year) {
+
+        if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+}

+ 80 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/test5/ThreadPool.java

@@ -0,0 +1,80 @@
+package com.lc.day11.test5;
+
+import java.util.concurrent.*;
+
+/**
+ * ClassName: ThreadPool
+ * Package: com.lc.day11.test5
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 21:08
+ * @Version 1.0
+ */
+public class ThreadPool {
+
+    public static void main(String[] args) throws ExecutionException, InterruptedException {
+
+        String str = null;
+        StringBuffer sb = new StringBuffer();
+        sb.append(str);
+
+        System.out.println(sb.length());//
+
+        System.out.println(sb);//
+
+        StringBuffer sb1 = new StringBuffer(null);
+        System.out.println(sb1);//
+
+        ExecutorService executorService = Executors.newFixedThreadPool(10);
+
+        ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) executorService;
+        threadPoolExecutor.setMaximumPoolSize(50);
+        executorService.execute(new NumberThread1());
+
+        Future future = executorService.submit(new NumberThread3());//适合使用于Callable
+        System.out.println("总和为:" + future.get());
+
+        executorService.shutdown();
+
+
+        ThreadPoolExecutor threadPoolExecutor1 = new ThreadPoolExecutor(3,2,10,TimeUnit.HOURS,new ArrayBlockingQueue<>(2));
+    }
+}
+class NumberThread1 implements Runnable{
+
+    @Override
+    public void run() {
+        for(int i = 0;i <= 100;i++){
+            if(i % 2 == 0){
+                System.out.println(Thread.currentThread().getName() + ": " + i);
+            }
+        }
+    }
+}
+
+class NumberThread2 implements Runnable{
+
+    @Override
+    public void run() {
+        for(int i = 0;i <= 100;i++){
+            if(i % 2 != 0){
+                System.out.println(Thread.currentThread().getName() + ": " + i);
+            }
+        }
+    }
+}
+
+class NumberThread3 implements Callable{
+
+    @Override
+    public Object call() throws Exception {
+        int sum = 0;
+        for (int i = 0; i < 100; i++) {
+            if (i %2 == 0){
+                sum+=i;
+            }
+        }
+        return sum;
+    }
+}

+ 31 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/thread1/Test01.java

@@ -0,0 +1,31 @@
+package com.lc.day11.thread1;
+
+/**
+ * ClassName: Test01
+ * Package: com.lc.day11.thread1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 9:41
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) {
+
+        System.out.println(Thread.currentThread().getName());
+        //对象  内存  不溢出??
+        while (true){
+            new Test01();
+        }
+    }
+
+    @Override
+    protected void finalize() throws Throwable {
+        System.out.println("被回收");
+        //线程名称
+        System.out.println(Thread.currentThread().getName());
+
+        super.finalize();
+    }
+}

+ 21 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/thread2/MyThread.java

@@ -0,0 +1,21 @@
+package com.lc.day11.thread2;
+
+/**
+ * ClassName: MyThread
+ * Package: com.lc.day11.thread2
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 9:57
+ * @Version 1.0
+ */
+public class MyThread extends Thread{
+
+    @Override
+    public void run() {
+        for (int i = 0; i < 100; i++) {
+            //调用start自动执行的
+            System.out.println("MyThread - "+Thread.currentThread().getName()+"");
+        }
+    }
+}

+ 19 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/thread2/MyThread2.java

@@ -0,0 +1,19 @@
+package com.lc.day11.thread2;
+
+/**
+ * ClassName: MyThread2
+ * Package: com.lc.day11.thread2
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 10:04
+ * @Version 1.0
+ */
+public class MyThread2 implements Runnable{
+    @Override
+    public void run() {
+        for (int i = 0; i < 100; i++) {
+            System.out.println("MyThread - "+Thread.currentThread().getName()+"");
+        }
+    }
+}

+ 33 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/thread2/TestMyThread.java

@@ -0,0 +1,33 @@
+package com.lc.day11.thread2;
+
+/**
+ * ClassName: TestMyThread
+ * Package: com.lc.day11.thread2
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 9:58
+ * @Version 1.0
+ */
+public class TestMyThread {
+
+    public static void main(String[] args) {
+        MyThread myThread = new MyThread();
+        myThread.setName("线程1");
+        //start
+        myThread.start();
+
+        //线程2
+        MyThread2 myThread2 = new MyThread2();
+
+        //Thread start
+        Thread thread = new Thread(myThread2, "线程2");
+        thread.start();
+
+
+        //抢占 cpu
+        for (int i = 0; i < 100; i++) {
+            System.out.println(Thread.currentThread().getName()+"---执行");
+        }
+    }
+}

+ 81 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/thread3/Test01.java

@@ -0,0 +1,81 @@
+package com.lc.day11.thread3;
+
+/**
+ * ClassName: Test01
+ * Package: com.lc.day11.thread3
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 14:27
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) {
+        //资源类
+        Ticket ticket = new Ticket();
+
+        //线程
+        new Thread("线程1"){
+            @Override
+            public void run() {
+                ticket.sale();
+            }
+        }.start();
+        new Thread("线程2"){
+            @Override
+            public void run() {
+                ticket.sale();
+            }
+        }.start();
+        new Thread("线程3"){
+            @Override
+            public void run() {
+                ticket.sale();
+            }
+        }.start();
+
+
+    }
+
+
+    public static void main2(String[] args) {
+        //资源 票
+        //窗口 线程
+        //资源 票 同一个资源
+        TicketRunable ticketRunable = new TicketRunable();
+
+        //窗口 多个线程
+        Thread thread1 = new Thread(ticketRunable);
+        Thread thread2 = new Thread(ticketRunable);
+        Thread thread3 = new Thread(ticketRunable);
+
+        thread1.setName("线程1");
+        thread2.setName("线程2");
+        thread3.setName("线程3");
+
+        //启动
+        thread1.start();
+        thread2.start();
+        thread3.start();
+
+    }
+
+
+    public static void main1(String[] args) {
+        // 资源  + 窗口
+        WindowTicket windowTicket1 = new WindowTicket();
+        WindowTicket windowTicket2 = new WindowTicket();
+        WindowTicket windowTicket3 = new WindowTicket();
+
+        windowTicket1.setName("线程1");
+        windowTicket2.setName("线程2");
+        windowTicket3.setName("线程3");
+
+        windowTicket1.start();
+        windowTicket2.start();
+        windowTicket3.start();
+
+
+    }
+}

+ 28 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/thread3/Ticket.java

@@ -0,0 +1,28 @@
+package com.lc.day11.thread3;
+
+/**
+ * ClassName: Ticket
+ * Package: com.lc.day11.thread3
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 14:45
+ * @Version 1.0
+ */
+public class Ticket {
+
+    int ticket = 100;
+
+    public void sale(){
+        while (ticket > 0){
+            //暴露问题
+            try {
+                Thread.sleep(10); // 线程1 1 线程2 1 线程3 1
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+            System.out.println(Thread.currentThread().getName()+"-卖"+ticket);
+            ticket--;
+        }
+    }
+}

+ 32 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/thread3/TicketRunable.java

@@ -0,0 +1,32 @@
+package com.lc.day11.thread3;
+
+/**
+ * ClassName: TicketRunable
+ * Package: com.lc.day11.thread3
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 14:36
+ * @Version 1.0
+ */
+public class TicketRunable implements Runnable{
+
+    int ticket = 100; // 类
+
+
+
+    @Override
+    public void run() {
+
+        while (ticket > 0){
+            //暴露问题
+            try {
+                Thread.sleep(10); // 线程1 1 线程2 1 线程3 1
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+            System.out.println(Thread.currentThread().getName()+"-卖"+ticket);
+            ticket--;
+        }
+    }
+}

+ 34 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/thread3/WindowTicket.java

@@ -0,0 +1,34 @@
+package com.lc.day11.thread3;
+
+/**
+ * ClassName: WindowTicket
+ * Package: com.lc.day11.thread3
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 14:24
+ * @Version 1.0
+ */
+public class WindowTicket  extends Thread {
+    //共享 static
+    static int ticket = 100;
+
+    @Override
+    public void run() {
+        while ( true ){
+            if (ticket <= 0 ){
+                break;
+            }
+            try {
+                //线程1 卖  100    线程2 卖  100  线程3 卖  100
+                Thread.sleep(10); //暂停一下  效果明显
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+
+            System.out.println(Thread.currentThread().getName()+"---"+"正在卖"+ticket);
+
+            ticket--;
+        }
+    }
+}

+ 61 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/thread4/TestTicket.java

@@ -0,0 +1,61 @@
+package com.lc.day11.thread4;
+
+
+/**
+ * ClassName: TestTicket
+ * Package: com.lc.day11.thread4
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 15:49
+ * @Version 1.0
+ */
+public class TestTicket {
+
+    public static void main(String[] args) {
+        //资源类
+        Ticket ticket = new Ticket();
+
+        //线程
+        new Thread("线程1"){
+            @Override
+            public void run() {
+                while (true){
+                    try {
+                        Thread.sleep(10);
+                    } catch (InterruptedException e) {
+                        throw new RuntimeException(e);
+                    }
+                    ticket.sale();
+                }
+            }
+        }.start();
+        new Thread("线程2"){
+            @Override
+            public void run() {
+                while (true){
+                    try {
+                        Thread.sleep(10);
+                    } catch (InterruptedException e) {
+                        throw new RuntimeException(e);
+                    }
+                    ticket.sale();
+                }
+            }
+        }.start();
+        new Thread("线程3"){
+            @Override
+            public void run() {
+                while (true){
+                    try {
+                        Thread.sleep(10);
+                    } catch (InterruptedException e) {
+                        throw new RuntimeException(e);
+                    }
+                    ticket.sale();
+                }
+            }
+        }.start();
+
+    }
+}

+ 32 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/thread4/TestTicketRunable.java

@@ -0,0 +1,32 @@
+package com.lc.day11.thread4;
+
+/**
+ * ClassName: TicketRunable
+ * Package: com.lc.day11.thread3
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 14:36
+ * @Version 1.0
+ */
+public class TestTicketRunable {
+    public static void main(String[] args) {
+
+        TicketRunable ticketRunable1 = new TicketRunable(); // this
+        TicketRunable ticketRunable = new TicketRunable(); // this
+
+        //窗口 多个线程  保证同一把锁
+        Thread thread1 = new Thread(ticketRunable1);
+        Thread thread2 = new Thread(ticketRunable);
+        Thread thread3 = new Thread(ticketRunable);
+
+        thread1.setName("线程1");
+        thread2.setName("线程2");
+        thread3.setName("线程3");
+
+        //启动
+        thread1.start();
+        thread2.start();
+        thread3.start();
+    }
+}

+ 26 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/thread4/TestWindowTicket.java

@@ -0,0 +1,26 @@
+package com.lc.day11.thread4;
+
+/**
+ * ClassName: WindowTicket
+ * Package: com.lc.day11.thread3
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 14:24
+ * @Version 1.0
+ */
+public class TestWindowTicket  {
+    public static void main(String[] args) {
+        WindowTicket windowTicket1 = new WindowTicket();
+        WindowTicket windowTicket2 = new WindowTicket();
+        WindowTicket windowTicket3 = new WindowTicket();
+
+        windowTicket1.setName("线程1");
+        windowTicket2.setName("线程2");
+        windowTicket3.setName("线程3");
+
+        windowTicket1.start();
+        windowTicket2.start();
+        windowTicket3.start();
+    }
+}

+ 32 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/thread4/Ticket.java

@@ -0,0 +1,32 @@
+package com.lc.day11.thread4;
+
+/**
+ * ClassName: Ticket
+ * Package: com.lc.day11.thread3
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 14:45
+ * @Version 1.0
+ */
+public class Ticket {
+
+    int ticket = 100;
+
+    Object object  = new Object();
+
+    public void sale(){
+        //同步代码块
+        //synchronized (Ticket.class){
+        //synchronized (object){
+        synchronized (this){
+            if (ticket > 0){
+                //暴露问题
+                System.out.println(Thread.currentThread().getName()+"-卖"+ticket);
+                ticket--;
+            }else{
+                throw  new RuntimeException("没有飘了");
+            }
+        }
+    }
+}

+ 35 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/thread4/TicketRunable.java

@@ -0,0 +1,35 @@
+package com.lc.day11.thread4;
+
+/**
+ * ClassName: TicketRunable
+ * Package: com.lc.day11.thread3
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 14:36
+ * @Version 1.0
+ */
+public class TicketRunable implements Runnable{
+
+    int ticket = 100; // 类
+
+    public synchronized void saleOne(){ //this
+        if (ticket > 0){
+            System.out.println(Thread.currentThread().getName()+"-卖"+ticket);
+            ticket--;
+        }
+    }
+
+    @Override
+    public void run() {
+        while (ticket > 0){
+            //暴露问题  线程1  线程2  停滞
+            try {
+                Thread.sleep(10);
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+            saleOne();
+        }
+    }
+}

+ 37 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/thread4/WindowTicket.java

@@ -0,0 +1,37 @@
+package com.lc.day11.thread4;
+
+/**
+ * ClassName: WindowTicket
+ * Package: com.lc.day11.thread3
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 14:24
+ * @Version 1.0
+ */
+public class WindowTicket extends Thread {
+    //共享 static
+    static int ticket = 100;
+
+    //售票方法
+    public static synchronized void saleOne(){
+        if ( ticket > 0 ){
+
+            System.out.println(Thread.currentThread().getName()+"---"+"正在卖"+ticket);
+
+            ticket--;
+        }
+    }
+
+    @Override
+    public void run() {
+        while ( ticket > 0 ){
+            try {
+                Thread.sleep(10);
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+            saleOne();
+        }
+    }
+}

+ 54 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/thread5/HungrySingle.java

@@ -0,0 +1,54 @@
+package com.lc.day11.thread5;
+
+/**
+ * ClassName: HungrySingle
+ * Package: com.lc.day11.thread5
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 16:39
+ * @Version 1.0
+ */
+public class HungrySingle {
+
+    private static HungrySingle INSTANCE = new HungrySingle();
+    //对象是否声明为final 都可以
+
+    private HungrySingle(){}
+
+    public static HungrySingle getInstance(){
+        return INSTANCE;
+    }
+
+
+    static HungrySingle instance1;
+    static HungrySingle instance2;
+
+    public static void main(String[] args) {
+
+        Thread thread1 = new Thread() {
+            @Override
+            public void run() {
+                instance1 = HungrySingle.INSTANCE;
+            }
+        };
+
+        Thread thread2 = new Thread() {
+            @Override
+            public void run() {
+                instance2 = HungrySingle.INSTANCE;
+            }
+        };
+
+        try {
+            thread1.join();
+            thread2.join();
+            thread1.start();
+            thread2.start();
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        }
+
+        System.out.println(instance1 == instance2);
+    }
+}

+ 54 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/thread5/LazyOne.java

@@ -0,0 +1,54 @@
+package com.lc.day11.thread5;
+
+/**
+ * ClassName: LazyOne
+ * Package: com.lc.day11.thread5
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 16:43
+ * @Version 1.0
+ */
+public class LazyOne {
+
+    private static LazyOne instance;
+
+    LazyOne(){}
+
+    //方式1:
+    public static synchronized LazyOne getInstance1(){
+        if(instance == null){
+//            try {
+//                Thread.sleep(10);
+//            } catch (InterruptedException e) {
+//                throw new RuntimeException(e);
+//            }
+            instance = new LazyOne();
+        }
+        return instance;
+    }
+
+    //方式2:
+    public static LazyOne getInstance2(){
+        synchronized (LazyOne.class){
+            if(instance == null){
+                instance = new LazyOne();
+            }
+        }
+        return instance;
+    }
+
+    //方式3:双重验证
+    public static LazyOne getInstance3(){
+        if(instance == null){
+            synchronized (LazyOne.class){
+                if(instance == null){
+                    instance = new LazyOne();
+                }
+            }
+        }
+
+        return instance;
+    }
+
+}

+ 25 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/thread5/LazySingle.java

@@ -0,0 +1,25 @@
+package com.lc.day11.thread5;
+
+/**
+ * ClassName: LazySingle
+ * Package: com.lc.day11.thread5
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 16:51
+ * @Version 1.0
+ */
+public class LazySingle {
+
+    private LazySingle(){
+
+    }
+    public LazySingle getLazySingle(){
+        return  Inner.INTANCE;
+    }
+
+    private static class  Inner{
+        private  static LazySingle  INTANCE = new LazySingle();
+    }
+
+}

+ 45 - 0
01_JavaSe/JavaSe/day11/src/com/lc/day11/thread5/TestLazyOne.java

@@ -0,0 +1,45 @@
+package com.lc.day11.thread5;
+
+/**
+ * ClassName: LazyOne
+ * Package: com.lc.day11.thread5
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/27 16:43
+ * @Version 1.0
+ */
+public class TestLazyOne {
+
+    static LazyOne instance1;
+    static LazyOne instance2;
+
+    public static void main(String[] args) {
+
+        Thread thread1 = new Thread() {
+            @Override
+            public void run() {
+                instance1 = LazyOne.getInstance1();
+            }
+        };
+
+        Thread thread2 = new Thread() {
+            @Override
+            public void run() {
+                instance2 = LazyOne.getInstance1();
+            }
+        };
+
+        try {
+            thread1.start();
+            thread2.start();
+
+            thread1.join();
+            thread2.join();
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        }
+
+        System.out.println(instance1 == instance2);
+    }
+}

+ 29 - 0
01_JavaSe/JavaSe/day12/.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

+ 21 - 0
01_JavaSe/JavaSe/day12/day12.iml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library name="JUnit4">
+        <CLASSES>
+          <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.13.1/junit-4.13.1.jar!/" />
+          <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+  </component>
+</module>

+ 58 - 0
01_JavaSe/JavaSe/day12/src/com/lc/day12/exer/TestString01.java

@@ -0,0 +1,58 @@
+package com.lc.day12.exer;
+
+import org.junit.Test;
+
+import java.util.Random;
+import java.util.Scanner;
+
+/**
+ * ClassName: TestString01
+ * Package: com.lc.day12.exer
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/28 16:26
+ * @Version 1.0
+ */
+public class TestString01 {
+
+    public static void main(String[] args) {
+        test01();
+    }
+
+    public static void test01(){
+        //将用户输入的单词全部转为小写,如果用户没有输入单词,重新输入
+        Scanner scanner = new Scanner(System.in);
+
+        while (true){
+            System.out.println("请输入");
+            String word = scanner.next();
+            if (word.length() == 0){
+                continue;
+            }else {
+
+                String lowerCase = word.toLowerCase();
+                System.out.println(lowerCase);
+                break;
+            }
+        }
+    }
+
+
+    @Test
+    public void test02(){
+        //随机生成验证码,验证码由0-9,A-Z,a-z的字符组成  生成6位验码
+        String w  = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+        String code = "";
+        for (int i = 0; i < 6; i++) {
+            int r = new Random().nextInt(w.length());
+            //charAt
+            char c = w.charAt(r);
+            code+=c;
+        }
+
+        System.out.println(code);
+
+    }
+}

+ 16 - 0
01_JavaSe/JavaSe/day12/src/com/lc/day12/string4/Person.java

@@ -0,0 +1,16 @@
+package com.lc.day12.string4;
+
+/**
+ * ClassName: Person
+ * Package: com.lc.day12.string4
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/28 14:39
+ * @Version 1.0
+ */
+public class Person {
+
+    String name;
+
+}

+ 26 - 0
01_JavaSe/JavaSe/day12/src/com/lc/day12/string4/StringTest.java

@@ -0,0 +1,26 @@
+package com.lc.day12.string4;
+
+/**
+ * ClassName: StringTest
+ * Package: com.lc.day12.string4
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/28 15:12
+ * @Version 1.0
+ */
+public class StringTest {
+    String str = new String("good"); // 堆中
+    char[] ch = { 't', 'e', 's', 't' };
+
+    public void change(String str, char ch[]) {
+        str = "test ok"; //String 类型不可变 重新赋值
+        ch[0] = 'b';
+    }
+    public static void main(String[] args) {
+        StringTest ex = new StringTest();
+        ex.change(ex.str, ex.ch);
+        System.out.println(ex.str );//
+        System.out.println(ex.ch); //地址??
+    }
+}

+ 92 - 0
01_JavaSe/JavaSe/day12/src/com/lc/day12/string4/Test01.java

@@ -0,0 +1,92 @@
+package com.lc.day12.string4;
+
+import org.junit.Test;
+
+/**
+ * ClassName: Test01
+ * Package: com.lc.day12.string4
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/28 14:07
+ * @Version 1.0
+ */
+public class Test01 {
+
+
+    @Test
+    public void test05(){
+        String str = "hello";
+        String str2 = "world";
+        String str3 ="helloworld";
+
+        String str4 = "hello".concat("world");
+        String str5 = "hello"+"world";
+
+        System.out.println(str3 == str4);//
+        System.out.println(str3 == str5);//
+    }
+    @Test
+    public void test04(){
+        String s1 = "hello";
+        String s2 = "world";
+        String s3 = "helloworld";
+
+        String s4 = (s1 + "world").intern();// 常量池
+        String s5 = (s1 + s2).intern();
+
+        System.out.println(s3 == s4);//
+        System.out.println(s3 == s5);//
+    }
+
+    @Test
+    public void test03(){
+        String s1 = "hello";
+        String s2 = "world";
+        String s3 = "hello" + "world";  //常量池
+        String s4 = s1 + "world";  //堆
+        String s5 = s1 + s2;  //堆
+        String s6 = (s1 + s2).intern(); //常量池
+        System.out.println(s3 == s4); // false
+        System.out.println(s3 == s5); // false
+        System.out.println(s4 == s5); // false
+        System.out.println(s3 == s6); // true
+    }
+
+    @Test
+    public void test02(){
+        Person p1 = new Person();
+        p1.name = "Tom";
+
+        Person p2 = new Person();
+        p2.name = "Tom";
+
+        System.out.println(p1.name.equals( p2.name)); //  true 比较内容
+        System.out.println(p1.name == p2.name); // true
+        System.out.println(p1.name == "Tom"); // true
+
+
+        String s1 = "javaEE"; //指向常量池
+        String s2 = "javaEE";
+        String s3 = new String("javaEE"); //指向堆
+        String s4 = new String("javaEE");
+
+        System.out.println(s1 == s2);//  true
+        System.out.println(s1 == s3);//  false
+        System.out.println(s1 == s4);//  false
+        System.out.println(s3 == s4);//  false
+    }
+
+    @Test
+    public void test01(){
+
+        //123 在常量池中
+        String str = "123";
+
+
+        String s1 = "hello";
+        String s2 = "hello";
+        System.out.println(s1 == s2); //
+    }
+
+}

+ 137 - 0
01_JavaSe/JavaSe/day12/src/com/lc/day12/string5/TestString.java

@@ -0,0 +1,137 @@
+package com.lc.day12.string5;
+
+import org.junit.Test;
+
+import java.io.UnsupportedEncodingException;
+import java.util.Arrays;
+
+/**
+ * ClassName: TestString
+ * Package: com.lc.day12.string5
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/28 15:48
+ * @Version 1.0
+ */
+public class TestString {
+
+    /*
+    (16)String substring(int beginIndex) :返回一个新的字符串,它是此字符串的从beginIndex开始截取到最后的一个子字符串。
+    (17)String substring(int beginIndex, int endIndex) :返回一个新字符串,它是此字符串从beginIndex开始截取到endIndex(不包含)的一个子字符串。
+     */
+    @Test
+    public void test04(){
+        String str = "从前往后找当前字符串中xx,如果有";
+        String substring = str.substring(1);
+        System.out.println(substring);
+
+        String substring1 = str.substring(str.length() - 3);
+        System.out.println(substring1);
+
+        int i = str.indexOf("当前");
+        System.out.println(i);
+        String substring2 = str.substring(i, i + 2);
+        System.out.println(substring2);
+
+    }
+
+    /*
+    (11)boolean contains(xx):是否包含xx
+    (12)int indexOf(xx):从前往后找当前字符串中xx,即如果有返回第一次出现的下标,要是没有返回-1
+    (13)int indexOf(String str, int fromIndex):返回指定子字符串在此字符串中第一次出现处的索引,从指定的索引开始
+    (14)int lastIndexOf(xx):从后往前找当前字符串中xx,即如果有返回最后一次出现的下标,要是没有返回-1
+    (15)int lastIndexOf(String str, int fromIndex):返回指定子字符串在此字符串中最后一次出现处的索引,从指定的索引开始反向搜索。
+     */
+    @Test
+    public void test03(){
+        String str = "爱扣钉是一家靠谱的培训机构,爱扣钉可以说是IT培训的好地方,JavaEE是爱扣钉的当家学科,爱扣钉的前端和UI专业一样独领风骚。";
+
+        boolean b = str.contains("爱扣钉hahah");
+        System.out.println(b);
+
+        int i = str.indexOf("培训");
+        System.out.println(i);
+
+
+        int i1 = str.lastIndexOf("JavaEE111");
+        System.out.println(i1);
+
+    }
+
+    /*
+    ### 常用方法
+
+    (1)boolean isEmpty():字符串是否为空
+    (2)int length():返回字符串的长度
+    (3)String concat(xx):拼接
+    (4)boolean equals(Object obj):比较字符串是否相等,区分大小写
+    (5)boolean equalsIgnoreCase(Object obj):比较字符串是否相等,不区分大小写
+    (6)int compareTo(String other):比较字符串大小,区分大小写,按照Unicode编码值比较大小
+    (7)int compareToIgnoreCase(String other):比较字符串大小,不区分大小写
+    (8)String toLowerCase():将字符串中大写字母转为小写
+    (9)String toUpperCase():将字符串中小写字母转为大写
+    (10)String trim():去掉字符串前后空白符
+    (11)public String intern():结果在常量池中共享
+     */
+
+    @Test
+    public void test02(){
+        String str = "";
+        boolean empty = str.isEmpty();
+        System.out.println(empty);
+
+        str= "hello";
+        System.out.println(str.length());
+
+        String concat = str.concat("world");
+        System.out.println(concat);
+
+        System.out.println(str.equals("hello"));
+
+        String a = "c";
+        int i = a.compareTo("a");  //排序
+        System.out.println(i);
+        //0 相等  证书  大于   小于
+
+        String s1 = "  hello ";
+        System.out.println(s1);
+        String trim = s1.trim();
+        System.out.println(trim);
+    }
+
+    /*
+     * `public String(char[] value) ` :通过当前参数中的字符数组来构造新的String。
+     * `public String(char[] value,int offset, int count) ` :通过字符数组的一部分来构造新的String。
+     * `public String(byte[] bytes) ` :通过使用平台的**默认字符集**解码当前参数中的字节数组来构造新的String。
+     * `public String(byte[] bytes,String charsetName) ` :通过使用指定的字符集解码当前参数中的字节数组来构造新的String。
+     */
+    @Test
+    public void test01() throws UnsupportedEncodingException {
+        char[] arr = {'h','e','l','l','o'};
+
+        String s = new String(arr);
+        System.out.println(s);
+
+        String s1 = new String(arr,0,3);
+        System.out.println(s1);
+
+        byte[] bytes = {97,98,99};
+        byte[] zhong = {-28, -72, -83};
+
+        String s2 = new String(bytes);
+        System.out.println(s2);
+
+        String s3 = new String(zhong);
+        System.out.println(s3);
+
+        byte[] bytes1 = "中".getBytes("GBK");
+
+        System.out.println(Arrays.toString(bytes1));
+
+        byte[] bytes2 = {-42, -48};
+        String s4 = new String(bytes2,"GBK");
+        System.out.println(s4);
+
+    }
+}

+ 41 - 0
01_JavaSe/JavaSe/day12/src/com/lc/day12/thread1/PrintNumber.java

@@ -0,0 +1,41 @@
+package com.lc.day12.thread1;
+
+/**
+ * ClassName: PrintNumber
+ * Package: com.lc.day12.thread1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/28 9:32
+ * @Version 1.0
+ */
+public class PrintNumber implements Runnable{
+
+    int num = 0;
+
+    //
+
+    @Override
+    public void run() {
+        while (true){
+            //线程2 获取锁
+            synchronized (this){
+                //线程2 唤醒 线程1
+                notify();
+
+                if (num < 100){
+                    System.out.println(Thread.currentThread().getName()+"--"+(num++));
+                    try {
+                        //线程2 等待  线程2 释放锁
+                        wait();
+                    } catch (InterruptedException e) {
+                        throw new RuntimeException(e);
+                    }
+                }else {
+                    break;
+                }
+            }
+        }
+
+    }
+}

+ 25 - 0
01_JavaSe/JavaSe/day12/src/com/lc/day12/thread1/TestPrintNumber.java

@@ -0,0 +1,25 @@
+package com.lc.day12.thread1;
+
+/**
+ * ClassName: PrintNumber
+ * Package: com.lc.day12.thread1
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/28 9:32
+ * @Version 1.0
+ */
+public class TestPrintNumber {
+    public static void main(String[] args) {
+        PrintNumber printNumber = new PrintNumber();
+
+        Thread thread1 = new Thread(printNumber);
+        thread1.setName("线程1");
+        Thread thread2 = new Thread(printNumber);
+        thread2.setName("线程2");
+
+        thread1.start();
+        thread2.start();
+    }
+
+}

+ 31 - 0
01_JavaSe/JavaSe/day12/src/com/lc/day12/thread2/Comsumer.java

@@ -0,0 +1,31 @@
+package com.lc.day12.thread2;
+
+/**
+ * ClassName: Producer
+ * Package: com.lc.day12.thread2
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/28 10:11
+ * @Version 1.0
+ */
+public class Comsumer implements Runnable {
+
+    private Product product;
+
+    public Comsumer(Product product ){
+        this.product = product;
+    }
+
+    @Override
+    public void run() {
+        while (true){
+            try {
+                Thread.sleep(10);
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+            product.subProduct();
+        }
+    }
+}

+ 31 - 0
01_JavaSe/JavaSe/day12/src/com/lc/day12/thread2/Producer.java

@@ -0,0 +1,31 @@
+package com.lc.day12.thread2;
+
+/**
+ * ClassName: Producer
+ * Package: com.lc.day12.thread2
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/28 10:11
+ * @Version 1.0
+ */
+public class Producer implements Runnable {
+
+    private Product product;
+
+    public Producer( Product product ){
+        this.product = product;
+    }
+
+    @Override
+    public void run() {
+        while (true){
+            try {
+                Thread.sleep(20);
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+            product.addProduct();
+        }
+    }
+}

+ 52 - 0
01_JavaSe/JavaSe/day12/src/com/lc/day12/thread2/Product.java

@@ -0,0 +1,52 @@
+package com.lc.day12.thread2;
+
+/**
+ * ClassName: Product
+ * Package: com.lc.day12.thread2
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/28 10:05
+ * @Version 1.0
+ */
+public class Product {
+
+    int number = 0;
+
+    public static final int MAX = 20;
+    public static final int MIN = 1;
+
+
+    //添加
+    public synchronized void addProduct(){
+        if (number < MAX ){
+            number++;
+            System.out.println(Thread.currentThread().getName()+"产品数量:"+number);
+            //唤醒
+            notifyAll();
+        }else {
+            try {
+                wait();
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+        }
+    }
+    //减少
+    public synchronized void subProduct(){
+        if (number > MIN ){
+            number--;
+            System.out.println(Thread.currentThread().getName()+"产品数量:"+number);
+            //唤醒
+            notifyAll();
+        }else {
+            try {
+                wait();
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+        }
+    }
+
+
+}

+ 38 - 0
01_JavaSe/JavaSe/day12/src/com/lc/day12/thread2/TestProduct.java

@@ -0,0 +1,38 @@
+package com.lc.day12.thread2;
+
+/**
+ * ClassName: TestProduct
+ * Package: com.lc.day12.thread2
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/28 10:14
+ * @Version 1.0
+ */
+public class TestProduct {
+
+    public static void main(String[] args) {
+
+        Product product = new Product();
+        Producer producer = new Producer(product);
+        Comsumer comsumer1 = new Comsumer(product);
+        Comsumer comsumer2 = new Comsumer(product);
+
+        Thread p1 = new Thread(producer);
+        Thread p2 = new Thread(producer);
+        Thread c1 = new Thread(comsumer1);
+        Thread c2 = new Thread(comsumer2);
+
+        p1.setName("生产者1");
+        p2.setName("生产者2");
+        c1.setName("消费者1");
+        c2.setName("消费者2");
+
+        p1.start();
+        p2.start();
+        c1.start();
+        c2.start();
+
+
+    }
+}

+ 19 - 0
01_JavaSe/JavaSe/day12/src/com/lc/day12/thread3/MyRunable.java

@@ -0,0 +1,19 @@
+package com.lc.day12.thread3;
+
+/**
+ * ClassName: MyRunable
+ * Package: com.lc.day12.thread3
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/28 11:28
+ * @Version 1.0
+ */
+public class MyRunable implements Runnable{
+    @Override
+    public void run() {
+        for (int i = 0; i < 10 ; i++) {
+            System.out.println(Thread.currentThread().getName()+"---"+i);
+        }
+    }
+}

+ 26 - 0
01_JavaSe/JavaSe/day12/src/com/lc/day12/thread3/SumNumber.java

@@ -0,0 +1,26 @@
+package com.lc.day12.thread3;
+
+import java.util.concurrent.Callable;
+
+/**
+ * ClassName: SumNumber
+ * Package: com.lc.day12.thread3
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/28 11:18
+ * @Version 1.0
+ */
+public class SumNumber implements Callable {
+    @Override
+    public Object call() throws Exception {
+        int sum = 0;
+        for (int i = 0; i < 100 ; i++) {
+            sum = sum + i;
+
+            System.out.println(Thread.currentThread().getName()+"--"+i);
+        }
+
+        return sum;
+    }
+}

+ 35 - 0
01_JavaSe/JavaSe/day12/src/com/lc/day12/thread3/Test01.java

@@ -0,0 +1,35 @@
+package com.lc.day12.thread3;
+
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.FutureTask;
+
+/**
+ * ClassName: Test01
+ * Package: com.lc.day12.thread3
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/28 11:19
+ * @Version 1.0
+ */
+public class Test01 {
+
+    public static void main(String[] args) throws ExecutionException, InterruptedException {
+        //Callable 子类
+        SumNumber sumNumber = new SumNumber();
+
+        //FutureTask 实现  Runable
+        FutureTask futureTask = new FutureTask(sumNumber);
+
+        //线程
+        Thread thread = new Thread(futureTask);
+
+        thread.start();
+
+        //获取结果
+        Object o = futureTask.get();
+
+        System.out.println("和:"+o);
+
+    }
+}

+ 43 - 0
01_JavaSe/JavaSe/day12/src/com/lc/day12/thread3/Test02.java

@@ -0,0 +1,43 @@
+package com.lc.day12.thread3;
+
+import java.util.concurrent.*;
+
+/**
+ * ClassName: Test01
+ * Package: com.lc.day12.thread3
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/7/28 11:19
+ * @Version 1.0
+ */
+public class Test02 {
+
+    public static void main(String[] args) throws ExecutionException, InterruptedException {
+        //创建线程池
+        ExecutorService executorService = Executors.newFixedThreadPool(5);
+
+        //Runable 子类
+        MyRunable myRunable = new MyRunable();
+
+        //执行
+        executorService.execute(myRunable);
+
+
+        //callable
+        SumNumber sumNumber = new SumNumber();
+
+        Future submit = executorService.submit(sumNumber);
+
+        //获取结果
+        Object o = submit.get();
+        System.out.println(o);
+
+        executorService.shutdown();
+
+        //手动创建线程池
+        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(3, 2, 3, TimeUnit.SECONDS, null);
+
+
+    }
+}

BIN
01_JavaSe/JavaSe/out/production/day09/com/lc/day09/test6/ReturnExceptionDemo.class


BIN
01_JavaSe/JavaSe/out/production/day10/com/lc/day10/tes1/Communication.class


BIN
01_JavaSe/JavaSe/out/production/day10/com/lc/day10/test/DeadLockTest$1.class


BIN
01_JavaSe/JavaSe/out/production/day10/com/lc/day10/test/DeadLockTest$2.class


BIN
01_JavaSe/JavaSe/out/production/day10/com/lc/day10/test/DeadLockTest.class


BIN
01_JavaSe/JavaSe/out/production/day10/com/lc/day10/test/HungrySingle.class


BIN
01_JavaSe/JavaSe/out/production/day10/com/lc/day10/test/HungrySingleTest$1.class


BIN
01_JavaSe/JavaSe/out/production/day10/com/lc/day10/test/HungrySingleTest$2.class


BIN
01_JavaSe/JavaSe/out/production/day10/com/lc/day10/test/HungrySingleTest.class


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