EnumMap in Java
An EnumMap in Java is a specialized map implementation for use with enum type as the keys. In this post, we will learn EnumMaps in Java.
Yearly Archives: 2020
An EnumMap in Java is a specialized map implementation for use with enum type as the keys. In this post, we will learn EnumMaps in Java.
In this post, we will see six ways to convert a Java stream to a List. You can extend these if you want to convert a stream to a Set as well.
The Java 8 LongStream is a sequence of primitive long-valued elements and is a long primitive specialization of Stream.
Collectors.joining returns a Collector which concatenates the stream elements separated by a delimiter, prefix and suffix in encounter order.
Java 8 StringJoiner class can be used to build a sequence of characters that are separated by a configured delimiter, prefix and a suffix.
This post shows 4 ways to throw checked exceptions in Java streams i.e., having a lambda expression that can throw checked exception(s).
Java Streams has a distinct method which removes duplicates by object's equal method. This post explains ways to apply distinct by a property.
The Java Stream Distinct is a stateful intermediate operation which returns a new stream which has only the distinct elements in it.
The Java 8 Streams has findFirst and findAny methods which will return the first element and an arbitrary element from a stream respectively.
The Prototype Pattern specifies the kind of objects to create using a prototypical instance and create new objects by copying this prototype