Programming for fun and profit

Programming tutorials, problems, solutions. Always with code.

Java casting trick

Recently I’ve rediscovered Class.cast(object) that can be used to cast objects to a type. In Java 8 streams the method allows to do a nice Java casting trick.

Read More

Share with the World!

Java 8 flatMap practical example

In this post we’ll show a practical example of processing tree-like structure using streams and Java 8 flatMap.

Read More

Share with the World!

Create Java Streams

There are many ways to create Java Streams and for each of them we’ll show examples. This flexibility is needed especially when combined with flatMap!

Read More

Share with the World!
Pages:1234