Java Programming Tutorials

Java programming tutorials with many code examples!

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!

Spring find annotated classes

Problem:

How to find annotated classes using Spring and read metadata from them? Sometimes you may want to attach metadata to your classes using custom annotations. Here’s an example how you can leverage Spring‘s classpath scanning mechanism to do that.

Read More

Share with the World!

Java Reflection Generic Type

Problem:

How to get Java generic type parameter using reflection in runtime? Java doesn’t make it easy with type erasure, but it’s possible. See how.

Read More

Share with the World!

Bash array

Problem:

How to use Bash arrays? Bash is very flexible and allows to do funny things with arrays. Check out these cool Bash array examples.

Read More

Share with the World!

Java immutable List

Problem:

How to create an immutable List in Java? There are couple of ways to do that, one of them is to use Java Collections Framework as can be seen in the following example.

Read More

Share with the World!

Java synchronized List

Problem:

How to use Java List in a thread-safe way? It can be synchronized manually or you can use a wrapper method from Java Collections Framework. Learn how to use it correctly.

Read More

Share with the World!

Java List swap

Problem:

How to swap elements in Java List? Swap operation is very often used when implementing sorting. In the following example we show Java List swap operation from Java Collections Framework.

Read More

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