Java Programming Tutorials

Java programming tutorials with many code examples!

Java read XML using DOM

Java read XML using DOM

Java DOM API is comfortable to work with not big XML documents. They can be easily loaded and modified in runtime. In this post we show how to do it.

Read More

Share with the World!

Java create XML using DOM

Java create XML using DOM

Java allows to work with XML in many different ways. In this post we show how to use Java DOM API to create a document and write it as XML file.

Read More

Share with the World!

Java CyclicBarrier – game simulation

Java CyclicBarrier is very convenient synchronization tool for writing concurrent simulations. In this post we’ll show how it works and write a game simulation.

Read More

Share with the World!

Java Reverse String in 2 ways

Java Reverse String in 2 ways

Java String doesn’t have reverse method, so it may not be immediately apparent how to reverse a string in Java. Here are two ways do do it.

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!
Pages:1234567...19