Annotation
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Date;
/**
*
* @author bhavesh
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.TYPE)
public @interface NewAnnotation {
public String name();
public int myno() default 10;
//public Date mydate =new Date();
}
/**
*
* @author bhavesh
*/
class A
{
public void test()
{
}
}
class B extends A
{
@Override
public void test()
{
}
}
// Use of annotation called NewAnnotation ....
@NewAnnotation(name="ISTAR")
public class ClassAnnotationTest {
}
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Date;
/**
*
* @author bhavesh
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.TYPE)
public @interface NewAnnotation {
public String name();
public int myno() default 10;
//public Date mydate =new Date();
}
/**
*
* @author bhavesh
*/
class A
{
public void test()
{
}
}
class B extends A
{
@Override
public void test()
{
}
}
// Use of annotation called NewAnnotation ....
@NewAnnotation(name="ISTAR")
public class ClassAnnotationTest {
}
Comments
Post a Comment