You need to create an @interface annotation as defined in the homework.
Annotate a method with your annotation using the provided data.
Then read, and print the information in that annotation using code similar to that in exercise 6 except accessing the method annotation rather than the class annotation.

I found information in the following set of examples to be VERY helpful in solving this homework (in fact this is a pretty good reference to practical Java solutions):

http://www.java2s.com/Code/Java/Reflection/defaultvaluesinanannotation.htm

This homework seemed to stump a lot of us but once you see the solution it is actually quite easy!

Good luck.

DenS

Heba Samy wrote:
Hey All,

please i don't understand this point in the hw of annotations :
Use Runtime annotation API to retrieve the values of the annotation (as you've done in Exercise 6 above) and display them.
How to display them??
and here is my code :

public class MyAnnotation {

    private String name;
    public MyAnnotation(){
       
    }
    @RequestForEnhancement(id=1,synopsis="done",engineer="Heba",date="1/1/2009")
    public void setName(String name){
        this.name = name;
    }
    public static void main(String[] args) {
        
    }

}
what did he mean by display them??!!
thanks in advance,
Heba




--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to