Java : multi-line string, text blocks

Java multi-line string text blocks : This article will show you a few ways to declare and use a multi-line string in Java. String + String + String StringBuilder String.format StringWriter String.join (Java 8) Files.lines (Java 8) (“””) Java 13 and Java 14 text blocks (preview feature) Java multi-line string text blocks : Review an […]

En Lire Plus

Java 11 shebang example in Docker

Java 11 shebang example in Docker : In Java 11, JEP 330 adds support to run single-file source code directly. Terminal : This indirectly supports the Java single-file program to run as a script using Unix Shebang. For example, run below .sh file will print Hello World! run.sh : Make sure the !# is pointed to the […]

En Lire Plus

Example of Java SSLSocket TLS 1.3

example of Java SSLSocket TLS 1.3 : This Java 11 JEP 332 adds support for TLS 1.3 protocol. SSLSocket + TLS 1.3 An SSLSocket client with TLS1.3 protocol and TLS_AES_128_GCM_SHA256 stream cipher, to send a request to https://google.com and print the response. JavaTLS13.java : Output Terminal : The above source code is a copy from this Oracle – […]

En Lire Plus