Skip to content

Commit f8f3049

Browse files
committed
Restructure README layout.
1 parent 20d20b8 commit f8f3049

File tree

1 file changed

+52
-45
lines changed

1 file changed

+52
-45
lines changed

README.md

+52-45
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
1-
# JavaCoreSnippets
2-
programs and code snippets to showcase the might of Java platform (as of Java API), algorithms implemented using Java language and the types and method to refer and use in other projects.
1+
# Java Core Snippets
2+
- programs and code snippets to showcase the might of Java platform (as of Java API), algorithms implemented using Java language, and the types & methods to refer & use in other projects.
33

4-
## Java 11 API
5-
New features available in Java SE 11. These are the features added to JLS in the versions later to Java SE 8. Most frequently used features are:
6-
- Method `T[] Collection.toArray(IntFunction<T[]> generator )` to use instead of first generating a stream and then invoking `A[] Stream.toArray(IntFunction<A[]> generator);`
7-
![Collection toArray(generator)](./assets/java11features/01-Collection-toArray.png)
8-
- Methods `String Files.readString(Path.of(filePath))` and `Path Files.writeString(Path.of(strFilePath),"string content", StandardOpenOption)`.
9-
![Files methods: readString() and writeString()](./assets/java11features/02-FilesReadString-FilesWriteString.png)
10-
- Class `java.net.http.HttpClient` capable of making GET, PUT, POST requests easily.
11-
![Convenient HttpClient](./assets/java11features/03-HttpClient-1.png)
12-
![Convenient HttpClient](./assets/java11features/03-HttpClient-2.png)
13-
- Running a Java class directly with `java` command as in `$ java MainClass.java` without generating a `.class` file a priori.
14-
![Running Java program with java interpreter command directly](./assets/java11features/04-RunWith-java.png)
15-
- Usage of `var` keyword for variable declaration in lambda expressions: ` (@Nonnull var a,@Nullable var b) -> System.out.println(a + b)`
16-
![Local var declaration in lambda](./assets/java11features/05-Local-varInLambda.png)
17-
- Method `Optional.isEmpty()` to check if the contained value is null. Its definition straight from Java API is:
18-
`public boolean isEmpty() {
19-
return value == null;
20-
}`
21-
![Optional isEmpty() method](./assets/java11features/06-Optional-isEmptyMethod.png)
22-
- A number of new methods foster our most-loved class `java.lang.String`. These are: `isBlank()`, `strip()`, `stripLeading()`, `stripTrailing()`, `repeat(intCount)`
23-
![New methods in String class](./assets/java11features/07-StringMethods-1.png)
24-
![New methods in String class](./assets/java11features/07-StringMethods-2.png)
4+
- First of all, let's start with some of the updates and advancements in Java library (aptly called Java API).
5+
6+
## What's available in Java 17 API
7+
New features available in Java 17 over Java 14. Features, which are most notable and stand as the best candidates for frequent use, are listed below:
8+
- restore always-Strict floating-point semantics: It ensures same results of floating-point calculations on every platform.
9+
- enhanced pseudo-random number generators: class java.util.Random implements interface java.util.random.RandomGenerator. Such new implementations of pseudo random number generators allow for better support for stream-based programming.
10+
- new macOS rendering pipeline
11+
- macOS/AArch64 port
12+
- deprecate the Applet API for removal
13+
- strongly encapsulate JDK internals
14+
- pattern matching for switch (preview)
15+
![Pattern matching with switch](./assets/java17features/patternMatchingWithSwitch.png)
16+
- remove RMI activation
17+
- sealed classes
18+
- remove the experimental AOT and JIT compilers
19+
- deprecate the Security Manager for removal
20+
- Foreign Function and Memory API (incubator)
21+
- Vector API (second incubator)
22+
- context-specific deserialization filters
23+
24+
### TODO
25+
To add the screenshots for Java 17 features to README for quick illustration. Screenshots are already in `assets` directory.
2526

26-
## Java 14 API
27-
New features available in Java SE 14. These are the features added to JLS in the versions later to Java SE 11. Most frequently used features are:
27+
## What's available in Java 14 API
28+
The additional and formally introduced features available in Java 14. These are the features added to JLS in the versions later to version 11. Most frequently used features are:
2829
- Enhanced `instanceof` operator for safe type conversion: Now use `if (obj instanceof String str)` instead of `if (obj instanceof String)` to get a pre-cooked variable `str` of type `String`, for example, to utilise inside the concerned code block.
2930
![InstanceOf Pattern Matching](./assets/java14features/01-InstanceOfPatternMatching.png)
3031
- More explanatory NullPointerException message. Run the super-method `main` of `NullPointerExceptionPlus` to get:
@@ -62,26 +63,28 @@ New features available in Java SE 14. These are the features added to JLS in the
6263
![TextBlock for preformatted String literals](./assets/java14features/05-TextBlock-1.png)
6364
![TextBlock for preformatted String literals](./assets/java14features/05-TextBlock-2.png)
6465

65-
## Java 17 API
66-
New features available in Java SE 17. These are the features added to JLS in the versions later to Java SE 17. Most frequently used features are listed below:
67-
- restore always-Strict floating-point semantics: It ensures same results of floating-point calculations on every platform.
68-
- enhanced pseudo-random number generators: class java.util.Random implements interface java.util.random.RandomGenerator. Such new implementations of pseudo random number generators allow for better support for stream-based programming.
69-
- new macOS rendering pipeline
70-
- macOS/AArch64 port
71-
- deprecate the Applet API for removal
72-
- strongly encapsulate JDK internals
73-
- pattern matching for switch (preview)
74-
![Pattern matching with switch](./assets/java17features/patternMatchingWithSwitch.png)
75-
- remove RMI activation
76-
- sealed classes
77-
- remove the experimental AOT and JIT compilers
78-
- deprecate the Security Manager for removal
79-
- Foreign Function and Memory API (incubator)
80-
- Vector API (second incubator)
81-
- context-specific deserialization filters
66+
## Java 11 API
67+
The nice features available in Java 11 over our good old friend Java 8. Most notable additions are:
68+
- Method `T[] Collection.toArray(IntFunction<T[]> generator )` to use instead of first generating a stream and then invoking `A[] Stream.toArray(IntFunction<A[]> generator);`
69+
![Collection toArray(generator)](./assets/java11features/01-Collection-toArray.png)
70+
- Methods `String Files.readString(Path.of(filePath))` and `Path Files.writeString(Path.of(strFilePath),"string content", StandardOpenOption)`.
71+
![Files methods: readString() and writeString()](./assets/java11features/02-FilesReadString-FilesWriteString.png)
72+
- Class `java.net.http.HttpClient` capable of making GET, PUT, POST requests easily.
73+
![Convenient HttpClient](./assets/java11features/03-HttpClient-1.png)
74+
![Convenient HttpClient](./assets/java11features/03-HttpClient-2.png)
75+
- Running a Java class directly with `java` command as in `$ java MainClass.java` without generating a `.class` file a priori.
76+
![Running Java program with java interpreter command directly](./assets/java11features/04-RunWith-java.png)
77+
- Usage of `var` keyword for variable declaration in lambda expressions: ` (@Nonnull var a,@Nullable var b) -> System.out.println(a + b)`
78+
![Local var declaration in lambda](./assets/java11features/05-Local-varInLambda.png)
79+
- Method `Optional.isEmpty()` to check if the contained value is null. Its definition straight from Java API is:
80+
`public boolean isEmpty() {
81+
return value == null;
82+
}`
83+
![Optional isEmpty() method](./assets/java11features/06-Optional-isEmptyMethod.png)
84+
- A number of new methods foster our most-loved class `java.lang.String`. These are: `isBlank()`, `strip()`, `stripLeading()`, `stripTrailing()`, `repeat(intCount)`
85+
![New methods in String class](./assets/java11features/07-StringMethods-1.png)
86+
![New methods in String class](./assets/java11features/07-StringMethods-2.png)
8287

83-
//TODO
84-
To insert the screenshots into README for quick illustration. Screenshots are already in `assets` directory.
8588

8689
## Java Core Snippets
8790
Code fragments and executable programs testing many variants and conditions with standard language features of Java API. Some of the `.java` files here are:
@@ -106,4 +109,8 @@ Guidelines on the preferred usage of major Java 8 features and API methods:
106109
- Java 8 DateTime code samples.md
107110
- Java 8 Functional Interfaces in Java API.md
108111
- Java Concurrency API.md
109-
- Java Stream collector-s methods.md
112+
- Java Stream collector-s methods.md
113+
114+
## Notes
115+
- PoC implementations of the gists will keep on adding gradually.
116+

0 commit comments

Comments
 (0)