Java Programming Tutorials

Java programming tutorials with many code examples!

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!

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!

Selection Sort in Java

Selection Sort in Java

Selection Sort is one of many sorting algorithms, but unlike a few others it is easy to understand and implement as we’re going to show here!

Read More

Share with the World!

Java binary search comparator

Problem:

Java Binary Search with Comparator is very flexible method to search for elements of any type. In this tutorial you will learn how to use binary search in Java with own Comparator!

Read More

Share with the World!

Java binary search

Problem:

Java binary search is very fast way to find an element in a sorted collection of elements or find a place where it should be inserted. In this tutorial you will learn how to effectively use binary search in Java!

Read More

Share with the World!

Fizz Buzz in Java

Problem:

How to write Fizz Buzz in Java?

The problem is as follows:

Write a program that prints the numbers from 1 to 100. But for multiples of three print ‘Fizz’ instead of the number and for the multiples of five print ‘Buzz’. For numbers which are multiples of both three and five print ‘FizzBuzz’.

It’s a very common task on job interviews.

Read More

Share with the World!
Pages:12