Java Programming Tutorials

Java programming tutorials with many code examples!

Java Properties store

Problem:

How to store Java Properties? Properties class has methods to store/save to different outputs – OutputStream, Writer or even XML file. Here’s an example of Properties.store(OutputStream).

Read More

Share with the World!

Java list Properties

Problem:

How to list Java Properties? Properties can be written to PrintWriter or PrintStream as we demonstrate in the example below.

Read More

Share with the World!

Java System properties

Problem:

How to read Java System Properties? In the following example we show how to read single System property, list all, and use default when property is not defined.

Read More

Share with the World!

Java null check

Problem:

How to do null check in Java? The old way was to do validation manually, but since Java 7 there’s a better way. In the following example we show the difference.

Read More

Share with the World!

Java Objects equals hashcode

Problem:

How to implement equals and hashcode using java.util.Objects? In the following example we show how to use these great, null-insensitive helper methods.

Read More

Share with the World!

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!
Pages:123