diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 584edc6a20..f4a848e84b 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -9,18 +9,29 @@
+
-
+
+
+
+
+
+
+
+
+
+
-
+
+
-
+
@@ -30,13 +41,8 @@
-
-
-
-
+
-
-
@@ -103,7 +109,6 @@
-
@@ -168,6 +173,7 @@
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
index 789cc552fc..bb0ed5dd9e 100644
--- a/.idea/encodings.xml
+++ b/.idea/encodings.xml
@@ -1,16 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 5581558b26..c9de2abb83 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -9,8 +9,14 @@
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 1ee220d083..649b14544d 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,9 +4,20 @@
-
+
+
+
+
-
+
+
+
+
+
+
+
+
+
@@ -19,9 +30,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -34,6 +61,9 @@
+
+
+
@@ -47,18 +77,21 @@
-
+
+
-
-
-
+
+
+
+
+
@@ -66,7 +99,7 @@
-
+
@@ -106,81 +139,81 @@
-
-
+
+
-
+
-
-
-
+
+
+
-
-
+
+
-
+
-
-
-
+
+
+
-
-
+
+
-
+
-
-
-
+
+
+
-
-
+
+
-
+
-
-
-
+
+
+
-
-
+
+
-
+
-
-
-
+
+
+
@@ -295,11 +328,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -315,27 +348,20 @@
-
-
- 1651174204368
-
-
-
- 1651174204368
-
-
- 1651177632761
-
-
-
- 1651177632761
-
-
- 1651189931419
-
-
-
- 1651189931419
+
+
+
+
+
+
+
+
+
+
+
+
+
+
1651189968886
@@ -449,7 +475,238 @@
1651418643865
-
+
+ 1651442554199
+
+
+
+ 1651442554199
+
+
+ 1651443467506
+
+
+
+ 1651443467506
+
+
+ 1651495910094
+
+
+
+ 1651495910094
+
+
+ 1651496058923
+
+
+
+ 1651496058923
+
+
+ 1651500398300
+
+
+
+ 1651500398300
+
+
+ 1651508482993
+
+
+
+ 1651508482993
+
+
+ 1651508522565
+
+
+
+ 1651508522565
+
+
+ 1651508558018
+
+
+
+ 1651508558018
+
+
+ 1651592866470
+
+
+
+ 1651592866470
+
+
+ 1651593497493
+
+
+
+ 1651593497493
+
+
+ 1651593585899
+
+
+
+ 1651593585899
+
+
+ 1651593620046
+
+
+
+ 1651593620046
+
+
+ 1651593649959
+
+
+
+ 1651593649959
+
+
+ 1651667224688
+
+
+
+ 1651667224688
+
+
+ 1651667966498
+
+
+
+ 1651667966498
+
+
+ 1651667990674
+
+
+
+ 1651667990674
+
+
+ 1651668008146
+
+
+
+ 1651668008146
+
+
+ 1651668048643
+
+
+
+ 1651668048643
+
+
+ 1651668076639
+
+
+
+ 1651668076639
+
+
+ 1651668511746
+
+
+
+ 1651668511746
+
+
+ 1651668639673
+
+
+
+ 1651668639673
+
+
+ 1651668945359
+
+
+
+ 1651668945359
+
+
+ 1652467217267
+
+
+
+ 1652467217267
+
+
+ 1652467251548
+
+
+
+ 1652467251548
+
+
+ 1652467279738
+
+
+
+ 1652467279738
+
+
+ 1652467314121
+
+
+
+ 1652467314121
+
+
+ 1652467461911
+
+
+
+ 1652467461911
+
+
+ 1652467548356
+
+
+
+ 1652467548356
+
+
+ 1652472239719
+
+
+
+ 1652472239719
+
+
+ 1652708735437
+
+
+
+ 1652708735437
+
+
+ 1653584133351
+
+
+
+ 1653584133352
+
+
+ 1653591608248
+
+
+
+ 1653591608248
+
+
+ 1653593301467
+
+
+
+ 1653593301467
+
+
@@ -467,26 +724,32 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -502,8 +765,18 @@
- file://$PROJECT_DIR$/core-java-modules/core-java-collections-list/src/test/java/com/ossez/java/list/ReverseIteratorUnitTest.java
- 88
+ file://$PROJECT_DIR$/core-java-modules/core-java-11-2/src/test/java/com/ossez/optional/OptionalUnitTest.java
+ 28
+
+
+
+ file://$PROJECT_DIR$/core-java-modules/core-java-11-2/src/test/java/com/ossez/optional/OptionalUnitTest.java
+ 69
+
+
+
+ file://$PROJECT_DIR$/core-java-modules/core-java-strings/src/main/java/com/baeldung/multiline/MultiLineString.java
+ 73
diff --git a/README.md b/README.md
index 82a893264f..4dafa7e44e 100644
--- a/README.md
+++ b/README.md
@@ -21,11 +21,7 @@
| 电子邮件 | [service@ossez.com](mailto:service@ossez.com) |
| QQ 或微信 | 103899765 |
| QQ 交流群 | 15186112 |
-| 社区论坛 | [https://www.ossez.com/](https://www.ossez.com/) |
-| WIKI 维基 | [https://www.cwiki.us/](https://www.cwiki.us/) |
-| CN 博客 | [https://www.cwikius.cn/](https://www.cwikius.cn/) |
-
-## 公众平台
+| 社区论坛 | [ 公众平台
我们建议您通过社区论坛来和我们进行沟通,请关注我们公众平台上的账号
## 微信公众号
@@ -34,4 +30,8 @@
## 头条号
我们也在头条号上创建了我们的公众号,请扫描下面的 QR 关注我们的头条号。
-
\ No newline at end of file
+https://www.ossez.com/](https://www.ossez.com/) |
+| WIKI 维基 | [https://www.cwiki.us/](https://www.cwiki.us/) |
+| CN 博客 | [https://www.cwikius.cn/](https://www.cwikius.cn/) |
+
+##
\ No newline at end of file
diff --git a/core-java-modules/README.md b/core-java-modules/README.md
index 55dacca916..d07dff8751 100644
--- a/core-java-modules/README.md
+++ b/core-java-modules/README.md
@@ -4,7 +4,6 @@ This module contains modules about core Java
## Relevant articles:
-- [Multi-Module Maven Application with Java Modules](https://www.baeldung.com/maven-multi-module-project-java-jpms)
-- [Guide to Java FileChannel](https://www.baeldung.com/java-filechannel)
- [Understanding the NumberFormatException in Java](https://www.baeldung.com/java-number-format-exception)
-- [Will an Error Be Caught by Catch Block in Java?](https://www.baeldung.com/java-error-catch)
+
+
diff --git a/core-java-modules/core-java-11/README.md b/core-java-modules/core-java-11/README.md
index a3601c8339..f860b8b0c1 100644
--- a/core-java-modules/core-java-11/README.md
+++ b/core-java-modules/core-java-11/README.md
@@ -4,7 +4,7 @@ This module contains articles about Java 11 core features
### Relevant articles
-- [Java 11 Single File Source Code](https://www.baeldung.com/java-single-file-source-code)
+- [Java 11 Single File Source Code](https://www.baeldung.com/java-single-file-source-codehttps://www.baeldung.com/java-single-file-source-code)
- [Java 11 Local Variable Syntax for Lambda Parameters](https://www.baeldung.com/java-var-lambda-params)
- [Java 11 String API Additions](https://www.baeldung.com/java-11-string-api)
- [Java 11 Nest Based Access Control](https://www.baeldung.com/java-nest-based-access-control)
diff --git a/core-java-modules/core-java-8-2/pom.xml b/core-java-modules/core-java-8-2/pom.xml
index 6b3338804e..7c8a59c157 100644
--- a/core-java-modules/core-java-8-2/pom.xml
+++ b/core-java-modules/core-java-8-2/pom.xml
@@ -4,7 +4,6 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
core-java-8-2
- 0.1.0-SNAPSHOT
core-java-8-2
jar
diff --git a/core-java-modules/core-java-8-2/src/main/java/com/ossez/localization/App.java b/core-java-modules/core-java-8-2/src/main/java/com/ossez/localization/App.java
index 3fe6d8a267..a5047b8d92 100644
--- a/core-java-modules/core-java-8-2/src/main/java/com/ossez/localization/App.java
+++ b/core-java-modules/core-java-8-2/src/main/java/com/ossez/localization/App.java
@@ -6,13 +6,13 @@ import java.util.List;
import java.util.Locale;
public class App {
-
/**
* Runs all available formatter
- * @throws ParseException
+ *
+ * @param args
*/
public static void main(String[] args) {
- List locales = Arrays.asList(new Locale[] { Locale.UK, Locale.ITALY, Locale.FRANCE, Locale.forLanguageTag("pl-PL") });
+ List locales = Arrays.asList(new Locale[]{Locale.UK, Locale.ITALY, Locale.FRANCE, Locale.forLanguageTag("pl-PL")});
Localization.run(locales);
JavaSEFormat.run(locales);
ICUFormat.run(locales);
diff --git a/core-java-modules/core-java-numbers/src/test/java/com/ossez/number/foramt/NumberFormatExceptionTest.java b/core-java-modules/core-java-numbers/src/test/java/com/ossez/number/foramt/NumberFormatExceptionTest.java
new file mode 100644
index 0000000000..9f9207647a
--- /dev/null
+++ b/core-java-modules/core-java-numbers/src/test/java/com/ossez/number/foramt/NumberFormatExceptionTest.java
@@ -0,0 +1,35 @@
+package com.ossez.number.foramt;
+
+
+import org.apache.commons.lang3.math.NumberUtils;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInstance;
+
+import java.util.Arrays;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+
+@TestInstance(TestInstance.Lifecycle.PER_METHOD)
+public class NumberFormatExceptionTest {
+
+
+ String stringPassword = "password";
+ char[] charPassword = new char[]{'p', 'a', 's', 's', 'w', 'o', 'r', 'd'};
+
+ @Test
+ public void ConstructorNumberFormatException() {
+ Exception exception = assertThrows(NumberFormatException.class, () -> {
+ new Integer("one");
+ });
+
+ System.out.println(exception);
+
+ Integer aIntegerObj = new Integer("one");
+ Double doubleDecimalObj = new Double("two.2");
+ }
+
+
+
+}
diff --git a/core-java-modules/core-java-strings/src/main/java/com/baeldung/multiline/MultiLineString.java b/core-java-modules/core-java-strings/src/main/java/com/baeldung/multiline/MultiLineString.java
index 0a7d868486..5d333799c4 100644
--- a/core-java-modules/core-java-strings/src/main/java/com/baeldung/multiline/MultiLineString.java
+++ b/core-java-modules/core-java-strings/src/main/java/com/baeldung/multiline/MultiLineString.java
@@ -10,9 +10,9 @@ import java.nio.file.Files;
import java.nio.file.Paths;
public class MultiLineString {
-
+
String newLine = System.getProperty("line.separator");
-
+
public String stringConcatenation() {
return "Get busy living"
.concat(newLine)
@@ -22,7 +22,7 @@ public class MultiLineString {
.concat(newLine)
.concat("--Stephen King");
}
-
+
public String stringJoin() {
return String.join(newLine,
"Get busy living",
@@ -30,7 +30,7 @@ public class MultiLineString {
"get busy dying.",
"--Stephen King");
}
-
+
public String stringBuilder() {
return new StringBuilder()
.append("Get busy living")
@@ -42,7 +42,7 @@ public class MultiLineString {
.append("--Stephen King")
.toString();
}
-
+
public String stringWriter() {
StringWriter stringWriter = new StringWriter();
PrintWriter printWriter = new PrintWriter(stringWriter);
@@ -52,26 +52,23 @@ public class MultiLineString {
printWriter.println("--Stephen King");
return stringWriter.toString();
}
-
+
public String guavaJoiner() {
return Joiner.on(newLine).join(ImmutableList.of("Get busy living",
"or",
"get busy dying.",
"--Stephen King"));
}
-
+
public String loadFromFile() throws IOException {
return new String(Files.readAllBytes(Paths.get("src/main/resources/stephenking.txt")));
}
-
-// public String textBlocks() {
-//
-// // THIS ONLY FOR JDK 15
-// return """
-// Get busy living
-// or
-// get busy dying.
-// --Stephen King""";
-// }
+ public String textBlocks() {
+ return """
+ Get busy living
+ or
+ get busy dying.
+ --Stephen King""";
+ }
}
diff --git a/core-java-modules/core-java-strings/src/test/java/com/baeldung/multiline/MultiLineStringUnitTest.java b/core-java-modules/core-java-strings/src/test/java/com/baeldung/multiline/MultiLineStringUnitTest.java
index ca21b3e15c..66bc0a655b 100644
--- a/core-java-modules/core-java-strings/src/test/java/com/baeldung/multiline/MultiLineStringUnitTest.java
+++ b/core-java-modules/core-java-strings/src/test/java/com/baeldung/multiline/MultiLineStringUnitTest.java
@@ -16,7 +16,7 @@ public class MultiLineStringUnitTest {
assertEquals(ms.stringJoin(), ms.stringBuilder());
assertEquals(ms.stringBuilder(), ms.guavaJoiner());
assertEquals(ms.guavaJoiner(), ms.loadFromFile());
-// assertEquals(ms.loadFromFile(), ms.textBlocks());
+ assertEquals(ms.loadFromFile(), ms.textBlocks());
}
}
diff --git a/core-java-modules/pom.xml b/core-java-modules/pom.xml
index 8bf885516c..4178a8129b 100644
--- a/core-java-modules/pom.xml
+++ b/core-java-modules/pom.xml
@@ -16,6 +16,7 @@
core-java-8
+ core-java-8-2
core-java-11
core-java-11-2
core-java-annotations
@@ -27,7 +28,9 @@
core-java-collections-list-3
core-java-datetime-conversion
core-java-io
+ core-java-numbers
core-java-streams
+ core-java-strings
diff --git a/pom.xml b/pom.xml
index 0c9fabd839..f0e6683677 100644
--- a/pom.xml
+++ b/pom.xml
@@ -64,9 +64,10 @@
2.6
3.12.0
4.4
-
3.6.1
1.4
+ 2.11.0
+
3.0.0
@@ -141,6 +142,12 @@
commons-math3
${commons-math3.version}
+
+ commons-io
+ commons-io
+ ${commons-io.version}
+
+
org.apache.velocity
velocity-engine-core