Check out this post where we explore custom Java collectors and how to implement them with the Accumulative interface, making collectors much easier.
Category: Articles
Next Steps to Pattern Matching in Java with Java 12 and Switch Expressions aka JEP 325
It is interesting to see how the Java language evolves over time. One thing that I have always missed is pattern matching in a way similar to languages like Scala.Now there are different JDK Enhancement Proposals (JEP) aiming at bringing us a little bit closer to pattern matching, especially JEP 325 aka Switch Expressions that are included in the current Java 12 preview or JEP 305 aka Pattern Matching for instanceof.In the following article, I’d like to demonstrate how to use switch expr
Get the most from Java Function interface with this example – Coffee Talk: Java, News, Stories and Opinions
Interested in Java functional programming? The first place you need to start, especially if you use the Streams API, is with this Java Function interface example.
How to Find Middle Element of Linked List in Java in Single Pass
ow do you find the middle element of LinkedList in one pass is a programming question often asked Java and non-Java programmers in telepho…
How to Run Windows, Linux, macOS terminal commands in Java and return complete Result • Crunchify
Executing a system command is relatively simple – once you’ve seen it done the first time. It involves the use of two Java classes, the Runtime class and
#HOWTO: Generate PDFs (Apache PDFBox) including Charts (XChart) with Java EE
Generating documents for e.g. invoices or reports is a central use case for enterprise applications. As a Java developer, you have a wide range of possible libraries to manipulate and create Word, …
Thread, Code and Data – How a Multithreading Java Program Actually Run
There are certain things, which you don’t learn on academics or training class, you develop those understanding after few years of work exp…
Multiple null checks in Java 8
I have the below code which is bit ugly for multiple null checks.String s = null;if (str1 != null) { s = str1;} else if (str2 != null) { s = str2;} else if (str3 != null) { s = st…
Java Weekly, Issue 269 | Baeldung
New Spring Boot and Security releases are out this week, and a well-organized round-up of everything that has changed in Java and the JVM since JDK 8.
i18n in Java 11, Spring Boot, and JavaScript
Learn how to internationalize and localize your Java and Spring Boot apps.
Performance Comparison of Primitive Lists in Java | Baeldung
Compare the performance of some popular primitive list libraries in Java
Prime Number Generator Algorithm in Java – Sieve of Eratosthenes Example
Hello guys, I have said many times that a good knowledge of Data Structure and Algorithms is the first step towards becoming a better pro…
Using Throwaway Containers for Integration Testing with Java, JUnit 5 and Testcontainers
A lot of boilerplate code is written when developers need to test their applications with different connected systems like databases, stream platforms and other collaborators.Docker allows to handle those dependencies but there is still some glue code required to bind the container’s lifecycle and the configuration to the concrete integration test.Testcontainers is a testing library that offers lightweight throwaway instances of anything able to run in a Docker container, with bindings t
10 Object Oriented Design Principles Java Programmer Should Learn in 2019
The Object-Oriented Design Principles are the core of OOP programming, but I have seen most of the Java programmers chasing design patter…
Julia takes the stage while PHP continues its five-year slump – JAXenter
What programming languages should you learn? The PYPL Index suggests Python and Java are on top, Julia is rising fast, and PHP continues to fall.