Annotations have been a very important part of Java, and it’s been there from the time of J2SE 5.0. All of us have seen annotations like @Override
and @Deprecated
in our application code at some place or another. In this article, I will discuss what exactly annotations are, why they were introduced, how they work, how to write custom annotations (with example code), what could be valid scenarios for annotations, and lastly annotations and ADF. It’s going to be a long post, so grab some coffee and get ready to dive into the world of annotations.
What Are Annotations?
One word to explain annotation is metadata. Metadata is data about data. So annotations are metadata for code. For example, look at the following piece of code.