Java Programming Tutorials

Java programming tutorials with many code examples!

Java 8 create temporary file

Problem:

How to create a temporary file in Java 8?

Sometimes it’s needed to create a temporary file during tests, verify result, and then delete it at the end. As usual it can be easily done using Java 8 Files API.

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!