I am using following code to use Inherited Annotaion:
------TestAnnotation.java----------------------------------------------
import java.lang.annotation.Inherited;
@Inherited
public @interface TestAnnotation {
boolean isInherited() default true;
String doSomething() default "Do what?";
}
---------------------------------------------------------------------------
---------AnnotationChild.java------------------------------------------
@TestAnnotation
public class AnnotationChild {
public static void main(String [] args){
AnnotationChild ta = new AnnotationChild();
System.out.println("hello"+ta.doSomething());
}
}
--------------------------------------------------------------------------------
now i am getting compile time error.
The method doSomething() is undefined for the type AnnotationChild
i am not able to use the interface properties.
please guide where i m wrong.
Thanks
Ritesh