Java Programming Tutorials

Java programming tutorials with many code examples!

Java add array to list

Problem:

In Java there is a couple of ways to add an array of items to a collection. In the following examples we’ll cover a few of them.

Read More

Share with the World!

Java try with resources

Problem:

Java 7 finally has shipped try with resources construct that simplifies very common use case when developer had to open some resource and then close in finally block after usage. try with resources makes it very simple. Learn how!

Read More

Share with the World!

Java UnsupportedClassVersionError

Problem:

What means java.lang.UnsupportedClassVersionError: Unsupported major.minor version 52.0 and how to deal with it?

Read More

Share with the World!

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!