Java Programming Tutorials

Java programming tutorials with many code examples!

Java Properties load

Problem:

How to load Properties in Java? Properties class has methods to load properties from different sources – InputStream, Reader, and XML file. Here’s an example of Properties.load(InputStream).

Read More

Share with the World!

Java Properties store as XML

Problem:

How to store Java Properties as XML? It turns out that it’s not only possible, but also easy with the Properties class as you can see in the example in this post.

Read More

Share with the World!

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 Formattable example

Problem:

How to print Java object using custom format? Since Java 5 there’s Formattable interface exactly for that purpose. Here’s an example of how to use it.

Read More

Share with the World!

Bash script parameters

Problem:

How to process Bash script parameters? There are two ways – using while-case combo or with Bash getopts as we show in the following example.

Read More

Share with the World!
Pages:1...20212223242526...32