8000 Merge branch 'master' of https://github.com/PacktPublishing/Java-Codi… · agebru/Java-Coding-Problems@20cd0fd · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 20cd0fd

Browse files
committed
2 parents aec2dab + 1ca2ef2 commit 20cd0fd

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

Chapter01/P19_DeclareMultilineStrings/src/modern/challenge/Main.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,13 @@ public static void main(String[] args) {
3939
System.out.println("Text 4:" + LS + text4);
4040
System.out.println("--------------------------------------------");
4141

42-
// JDK 13 text blocks
43-
/*
42+
// JDK 13 text blocks
4443
String text5 = """My high school,
4544
the Illinois Mathematics and Science Academy,
4645
showed me that anything is possible
4746
and that you're never too young to think big.""";
4847
System.out.println("Text 5:" + LS + text5);
49-
System.out.println("--------------------------------------------");
50-
*/
48+
System.out.println("--------------------------------------------");
5149
}
5250

5351
}

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This is the code repository for [Java Coding Problems ](https://www.packtpub.com
77
**Improve your Java Programming skills by solving real-world coding challenges**
88

99
## What is this book about?
10-
* Adopt the latest JDK 11 and JDK 12 features in your applications
10+
* Adopt the latest JDK 8 - JDK 13 features in your applications
1111
* Solve cutting-edge problems relating to collections and data structures
1212
* Get to grips with functional-style programming using lambdas
1313
* Perform asynchronous communication and parallel data processing
@@ -29,13 +29,16 @@ All of the code is organized into folders. For example, Chapter02.
2929
The code will look like the following:
3030
```
3131
public Map<Character, Integer> countDuplicateCharacters(String str) {
32-
Map<Character, Integer> result = new HashMap<>();
33-
// or use for(char ch: str.toCharArray()) { ... }
34-
for (int i = 0; i<str.length(); i++) {
35-
char ch = str.charAt(i);
36-
result.compute(ch, (k, v) -> (v == null) ? 1 : ++v);
37-
}
38-
return result;
32+
33+
Map<Character, Integer> result = new HashMap<>();
34+
35+
// or use for(char ch: str.toCharArray()) { ... }
36+
for (int i = 0; i<str.length(); i++) {
37+
char ch = str.charAt(i);
38+
result.compute(ch, (k, v) -> (v == null) ? 1 : ++v);
39+
}
40+
41+
return result;
3942
}
4043
```
4144

0 commit comments

Comments
 (0)
0