Java Programming Tutorials

Java programming tutorials with many code examples!

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!

Bash case statement

Problem:

How to use Bash case statement to process complex conditionals? It’s most often used to process script parameters.

Read More

Share with the World!

Java find annotated classes

Problem:

How to find annotated classes in Java? JDK by itself doesn’t provide such mechanism, but there are libraries that can do that. One of them is Reflections, which is used in the following example.

Read More

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