Java Programming Tutorials

Java programming tutorials with many code examples!

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!

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!

Palindrome detector in Java

Palindrome is a sequence of chars which reads the same backward and forward. Detecting palindrome is a common job interview task therefore we’ll show how to implement that.

Read More

Share with the World!

Shuffle Algorithm in Java

Shuffling of arrays/lists sounds like a trivial task, but in reality it’s full of subtle traps. Here we show how to implement Fisher-Yates Shuffle Algorithm in Java.

Read More

Share with the World!
Pages:1234567...32