Because I am constantly busy working on something, I have never had time to actually put everything in words and pictures. But, since you got here, then you must have already seen some part of my work - and this is the way I’m talking.I'm 23, born in Romania, student at UPG Romania in software development field. I started from 0, mostly with basic stuff, and I’m evolving every day to an expert. I'm focused on freelancing projects, from small websites, to really heavy stuff. I know that I look and act differently from most developers, but this is why you will love to work with me!

Tuesday, April 12, 2011

What is a Java annotation


Probably you know the answer to this question, but we take the risk of boring you with a little description of a Java annotation. Take it as a short remember!

Annotations were introduced in Java starting with version 5.0 and they are commonly used to add meta-data information to classes, methods, fields and so on. Annotations are easy to recognize because they are marked by the “@” symbol, like you can see in the annotation definition, below:

public @interface MyAnnotation
{
// Property Definition here.
}

Note: Do not confuse the @interface with the Java reserved keyword interface.

Whether annotations can be applied to class, method or field is specified in the declaration of the annotation itself - this is known as meta-annotations (meta-data about meta-data).

No comments: