Overstock.com Interview Question
Software Engineer / DevelopersCountry: United States
Interview Type: In-Person
@Target(basically location of your annotation : It can be method,class,variable etc ..)
@Retention(basically tells the life time of your annotation : It can be compile time , class loading time or Runtime).
public @interface yourannotationname{
String yourattribute() default yourdefaultvalue;
Integer yourattribute() default yourdefaultvalueifany
}
After this you need to write a separate parser class which actually looks for the annotation in your class and provide you the respective functionality.
using @ symbol in java
- manoj December 10, 2012