BigDecimal and BigInteger in Java 1. Overview In this tutorial, we will demonstrate BigDecimal and the BigInteger classes. We’ll describe the two data types, their characteristics, and their usage scenarios. We’ll also briefly cover the various operations using the two classes. 2. BigDecimal BigDecimal represents an immutable arbitrary-precision signed decimal number.… Continue Reading java-bigdecimal-biginteger

Java Constructors vs Static Factory Methods 1. Overview Java constructors are the default mechanism for getting fully-initialized class instances. After all, they provide all the infrastructure required for injecting dependencies, either manually or automatically. Even so, in a few specific use cases, it’s preferable to resort to static factory methods… Continue Reading java-constructors-vs-static-factory-methods

Negate a Predicate Method Reference with Java 11 1. Overview In this short tutorial, we’ll see how to negate a Predicate method reference using Java 11. We’ll start with the limitations encountered in order to achieve this before Java 11. Then we’ll see how the Predicate.not() method helps, as well. 2. Before… Continue Reading java-negate-predicate-method-reference