We all know and appreciate Java Generics. It enables us to say "oh, this is a List of Strings", "oh, this is a Comparator for Integers", and the compiler will forbid you to add numbers to your list, or sorting your List of Strings by comparing Integers. Because it does not make sense. Before Generics was introduced in Java 5.0 in 2004, nothing was stopping you from expressing these nonsensical actions, and things would blow up when running your program, instead of being told already when writing the code that there is no way this will work.
Or –– how to upgrade your code base from JDK 8 to 11 and beyond.
Garbage collection (GC) has been one of Java's most compelling features since its inception. Allowing developers to focus on the core functionality of their application instead of memory management.
A couple of days ago, we had a look at two new features in Java 13 and 14. In today's article, we'll cover some more goodies arriving in the near future.
It's time to get on the fun train. Start simple by introducing small pieces of Kotlin into your existing Java code.
The release cycle of Java has changed quite dramatically recently, meaning we're getting new features at a more rapid pace than earlier. If you still hadn't had the time to read up on what's been going on the last releases, look no further!
With the new release cadence of Java and vendor landscape, managing multiple versions of Java can become a tedious task. However, tooling exists to make your life simpler.
Have you ever found it hard to debug Streams in Java? Allow me to introduce you to a very powerful tool in IntelliJ IDEA; Mr. Stream Trace.
Have you ever been annoyed that your tests take an incredibly long time? I have. A simple trick can save time by running (almost) all your tests in parallel.
No, not the Stream API introduced in Java 8, but the API for stream-based I/O which has been part of the JDK since Java 1.0. That is even older than the Collections Framework, which you had to wait until Java 1.2 to be available. And as with the Java Collections, even though the java.io API is quite dated, it is still heavily in use. InputStreams and OutputStreams are passed around, and consumed and written to, also in applications which are written nowadays.
Have you ever had the need for scheduling background tasks but always wanted a more lightweight alternative to Quartz Scheduler?
As a developer I spend most of my time at work in my IDE, for me that IDE is IntelliJ IDEA. During these years I have learned a few tricks, some useful keyboard-shortcuts and found a few plugins that have helped me be more effective in my day-to-day work. I want to share these lessons with you in the form of 4 IntelliJ ninja tricks!
During an application's lifespan you've probably added quite a few dependencies. But are all of them necessary? And are you using some libraries you're not even aware of? Today I'd like to talk a little bit about a maven plugin I'm a big fan of: maven-dependency-plugin.
Want to use the var keyword, but your team is stuck on Java 8? Lombok can help you. Sick and tired of writing and maintaining getters and setters? Lombok can help you.
JUnit 5 was released two years ago. Are you still running your tests with JUnit 4.12? Let’s change that, and get you started with JUnit 5.
Every object in Java has a toString() method which can be called to get a String-representation of any object at hand. If left unoverridden, it only yields a description of its class and hash code, and not really useful for much.
These days everything can run in a container. It may be databases, continuous integration systems, esoteric hobby projects and even Windows. In this article I’ll shine a light on various tips and tools that might be helpful when packaging Java based applications for running in containers.
Most developers will at some point be exposed to a dependency injection framework, and at first glance the whole thing can seem magical and hard to understand. Here we'll try to create a conceptual model of how DI-frameworks work.