Java Programming Tutorials

Java programming tutorials with many code examples!

Java Lang Tutorial

In Java Lang Tutorial you will learn handy features of classes from java.lang package!

Java Lang Classes

Reflection

Java Lang Exceptions

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!