Java Programming Tutorials

Java programming tutorials with many code examples!

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!

Prime numbers – Sieve of Eratosthenes in Java

Prime numbers – Sieve of Eratosthenes

A prime number is a natural number with only two divisors: 1 and itself.
In this post we’re going to show how to find prime numbers using Sieve of Eratosthenes and explain how it works.

Read More

Share with the World!

Java Singleton – enum implementation

Java Singleton – enum implementation

Singleton as enum is very simple to implement and very safe at the same time thanks to language guarantees for enum instantiation and serialization.

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!

Insertion Sort in Java

Insertion Sort in Java

Insertion Sort is another simple to understand and implement algorithm. Unlike Selection Sort it can work faster with certain data.

Read More

Share with the World!
Pages:12345678...19