Java Programming Tutorials

Java programming tutorials with many code examples!

Clojure for loop

Clojure for loop

The for loop in Clojure looks quite different than in most common languages. Here we’re going to show how to do some crazy things with it and how it relates to Java versions.

Read More

Share with the World!

Java Util Optional map(Function)

java.util.Optional.map(Function)

The method Optional.map(Function) applies the given function to the optional value if it is present and returns an optional with the result or empty optional.

Read More

Share with the World!

Java Util Optional.ofNullable(T)

java.util.Optional.ofNullable(T)

The method Optional.ofNullable(T) returns Optional containing given value if it was not null or an empty Optional in case of null value.

Read More

Share with the World!

Java Util Map replaceAll(BiFunction)

java.util.Map.replaceAll(BiFunction)

The method Map.replaceAll(BiFunction) replaces each value with the result of applying the given function on the corresponding entry. Rethrows exceptions thrown by the replacement function.

Read More

Share with the World!

Spring Field Injection

Spring field injection

This is probably the most common form of Dependency Injection, because it reduces a lot of boilerplate code needed with setter or constructor injections.

Read More

Share with the World!

Java Util Map.putIfAbsent(key, value)

java.util.Map.putIfAbsent(key, value)

The method Map.putIfAbsent(key, value) associates the given key with the given value if there is no such association or the current value in map is null. Returns null or the previous value.

Read More

Share with the World!
Pages:1...6789101112...32