Explore different options to convert a TemporalAccessor object to a LocalDate object in Java.
Search Results for: java.base
Check if an Element Is Present in a Set in Java
Learn to check if an element is in a Set in Java.
Java InputStream vs. InputStreamReader
Learn how an InputStreamReader builds on an InputStream to assist when working with streams of characters.
Flatten a Stream of Maps to a Single Map in Java
Learn to combine a stream of maps into a single result map in Java.
Check if a Given Time Lies Between Two Times Regardless of Date
Explore ways to determine if a particular time lies within the two times without considering dates.
Modify and Print List Items With Java Streams
Learn to modify or transform a Java list and print its new elements.
Gson TypeToken With Dynamic List Item Type
Learn how to convert a JSON array into an equivalent List with Gson.
Check if String is Base64 Encoded
Explore several methods of verifying if a string is Base64 encoded..
Collect Stream of entrySet() to a LinkedHashMap
Explore various ways to collect a stream of Map.Entry objects into a LinkedHashMap.
Storing UUID as Base64 String in Java
Learn how to store UUID as Base64 String using different approaches in Java.
Instantiate an Inner Class With Reflection in Java
Explore how to instantiate static and non-static inner classes with the Java Reflection API.
Set an Environment Variable at Runtime in Java
Learn how to have more control over the environment variables, especially for test scenarios.
Difference between ZoneOffset.UTC and ZoneId.of(“UTC”)
Explore the ZoneOffset.UTC and ZoneId.of(“UTC”) methods and their key differences and use cases.
Java 8 Stream Operation on the Empty List
Learn about Java 8 Stream operations on an empty List and understand the elegance and robustness of the Stream API.
Compress and Uncompress Byte Array Using Deflater/Inflater
A quick and practical guide to compressing/uncompressing a byte array using the Deflater/Inflater classes.
Comparing One String With Multiple Values in One Expression in Java
Discover various ways of finding a string among a group of strings using a single expression.
Handling NullPointerException in findFirst() When the First Element Is Null
To avoid NullPointerException when using findFirst() in Java, filter the stream before calling findFirst() or use Optional#ofNullable() to wrap values in an Optional object.
String vs StringBuffer Comparison in Java
Compare String and StringBuffer classes.
Context-Specific Deserialization Filters in Java 17
Explore Java’s latest enhancement, Context-Specific Deserialization Filter (JEP 415), in action.
Difference Between String isEmpty() and isBlank()
Delve into the distinctions between isEmpty() and isBlank() when working with Java Strings.