Java – Combine Multiple Collections 1. Overview In this tutorial, we will illustrate how to concatenate multiple collections into one logical collection. We’ll be exploring five different approaches – two using Java 8, one using Guava, one using Apache Commons Collections, and one using only the standard Java 7 SDK.… Continue Reading java-combine-multiple-collections

Converting Between Roman and Arabic Numerals in Java 1. Introduction The ancient Romans developed their own numeric system called Roman numerals. The system uses letters with different values to represent numbers. Roman numerals are still used today in some minor applications. In this tutorial, we’ll implement simple converters that will… Continue Reading java-convert-roman-arabic

Guide to Java BiFunction Interface 1. Introduction Java 8 introduced functional style programming, allowing us to parameterize general-purpose methods by passing in functions. We’re probably most familiar with the single-parameter Java 8 functional interfaces like Function, Predicate, and Consumer. In this tutorial, we’re going to look at functional interfaces that… Continue Reading java-bifunction-interface

Understanding the NumberFormatException in Java 1. Introduction Java throws NumberFormatException – an unchecked exception – when it cannot convert a String to a number type. Since it’s unchecked, Java does not force us to handle or declare it. In this quick tutorial, we’ll describe and demonstrate what causes NumberFormatException in Java… Continue Reading java-number-format-exception

Locality-Sensitive Hashing in Java Using Java-LSH Algorithms Java 1. Overview The Locality-Sensitive Hashing (LSH) algorithm hashes input items so that similar items have a high probability of being mapped to the same buckets. In this quick article, we will use the java-lsh library to demonstrate a simple use case of… Continue Reading locality-sensitive-hashing