Java 8 – String Deduplication in G1 Garbage Collector

String Deduplication is an additional feature of G1 Garbage collector, introduced in JDK 8 - 20th update. Its aim is to reduce the Java Heap Live data set by deleting the duplicate instances of a String Object.

Java 8 – Understanding String.join() and StringJoiner

Whenever there was a need to create a comma separated list of elements, we mostly used StringBuilder, or StringBuffer based on the use case. Well in Java 8, this kind of usage is addressed and developers added a Utility method inside the String class itself called the Join() method and a separate class StringJoiner  in java.util for more sophisticated operations.