How to get the environment variables in Java
In Java, the System.getenv() returns an unmodifiable string Map view of the current system environment. If a requested environment variable is not defined, the System.getenv will return a null, and…
Favourite tutorials for developers
In Java, the System.getenv() returns an unmodifiable string Map view of the current system environment. If a requested environment variable is not defined, the System.getenv will return a null, and…
Java 8 Stream examples to sort a Map, by keys or by values. Steps to sort a Map in Java 8: (1) Convert a Map into a Stream, (2) Sort…
A series of Java 8 up to date tips and examples, hope you like it. Java 11 reached General Availability on 25 September 2018, this is a Long Term Support…
In Java, the InputStreamReader accepts a charset to decode the byte streams into character streams. We can pass a StandardCharsets.UTF_8 into the InputStreamReader constructor to read data from a UTF-8…
In Java, the OutputStreamWriter accepts a charset to encode the character streams into byte streams. We can pass a StandardCharsets.UTF_8 into the OutputStreamWriter constructor to write data to a UTF-8…
A collection of Java date and time examples.
In this article, we will examine some example to convert String to Char array vise verse.
The Files.find API is available since Java 8. It searches or finds files from a file tree quickly. Examples: Find files by filename, Find files by file size, Find files…
This article focus on a few of the commonly used methods to read a file in Java. 1 - Files.lines, return a Stream (Java 8), 2 - Files.readString, returns a…
In Java, there are many ways to create and write to a file: using Files.newBufferedWriter (Java 8), using Files.write (Java 7), using PrintWriter, using File.createNewFile