Java Articles

Learn the latest Java developments and tips through our free articles

Java 9 Process API: The Shape of Things to Come

Mar 12, 2017

The JDK API for managing and controlling native Processes is getting a big update in Java 9. This article tells what’s changed and why it’s a great thing for the future of Java.

Read more

Implementing The Pipes and Filters Pattern using Actors in Akka for Java

Dec 26, 2016

In this article we will introduce a couple of interesting concepts from Akka by giving an overview of how to implement the pipes and filters enterprise integration pattern. Akka is a popular library that provides new approaches to write modern reactive software in Java and Scala.

Read more

Collection Factory Methods in Java 9

Nov 9, 2016

At IteratrLearning we love teaching Java courses, and find that a lot of the attendees enjoy coding in Java. One of the things that can irritate about Java, however, is that it’s often overly verbose or ceremonious when it comes to doing the most basic of things. One of the ways that Java 9 helps solve this problem is by providing ways of instantatiating collections from specific values in a very abbreviated way.

Read more

Asynchronous timeouts with CompletableFutures in Java 8 and Java 9

Sep 13, 2016

Java 8 introduced CompletableFuture<T> as an enhancement to Future<T>. It is a new class which lets you express the flow of information from different tasks using a callback driven style. A CompletableFuture is used for defining computations on singular events, which is a different use case than computations on streams of events (e.g. Observable using RxJava). In this article, you will learn about the problem with timeouts in Java 8’s CompletableFuture and the improvements that Java 9 brings.

Read more

Optional Improvements in Java 9

Sep 5, 2016

So we’ve already talked a little bit about the improvements in Java 9 to two features that were introduced in Java 8: Streams and Collectors. But what about one of our other Java 8 friends: Optional. At Iteratrlearning we’re real fans of the Optional type. We’ve found that, if used well, it can make your code more explicit and reduce the scope for bugs.

Read more

Collectors Improvements in Java 9

Aug 16, 2016

Collectors is an addition to Java 8 which let you specify data processing queries by aggregating the elements of a Stream into various containers such as Map, List and Set. For example, you can create a Map of the sum of expenses for each year as follows using the groupingBy and summingLong collector from the Collectors class. In the rest of this article we will assume static imports when referring to static method from the Collectors class.

Read more

Stream Improvements in Java 9

Aug 6, 2016

We’ve found, while teaching developers about lambdas and Streams in Java 8, that many developers really appreciate the code that comes out at the other end. It tends to read a lot more like the problem that developers are trying to solve than traditional for loops and, as a side effect, is often shorter to boot. That doesn’t mean that the Streams API is perfect or even complete. In this article we will be looking at a few small improvements that are scheduled for Java 9 that make it even better.

Read more

Solving a Parallel Streams Puzzler in Java 8

Jul 5, 2016

In this post, you will learn about a different approach from traditional Java programming that helps you to use parallel streams the right way in your code.

Read more

First Class Functions in Java 8

Jun 12, 2016

Java 8 adds functions as a new form of value. What does this mean? Let’s look at a simple example.

Read more

Unit Testing Lambda Expressions & Streams

Jun 1, 2016

Usually, when writing a unit test you call a method in your test code that gets called in your application. Given some inputs and possibly test doubles, you call these methods to test a certain behavior happening and then specify the changes you expect to result from this behavior.

Read more

Intersection Types: Java Generics’ most underused feature

May 12, 2016

Generic types were added to java way back in 2004 and have had extensive usage by different libraries and application developers ever since. Not all generics features have had equal usage though. In this blog post we’re going to explore Intersection Types: which are both one of the lesser-known features that Java Generics offers.

Read more

subscribe via RSS