0

I have created a custom annotation and it's working for 1'st program but not for 2'nd. I am not able to figure out what's wrong in the second one. Can anyone please explain:

Below Program is working:

@Schedule(dayOfMonth="last")
public void Calendar() {
      //Some Code goes Here.
}

Below Program not working:

@Event(startTime="22-Jun-2013")
@Event(startTime="22-June-2013", duration="21 Hours")
public void Calendar() {
      //Some Code goes Here.
}
Sotirios Delimanolis
  • 274,122
  • 60
  • 696
  • 724
Ankit Zalani
  • 3,068
  • 5
  • 27
  • 47
  • 3
    You cannot use the same annotation twice on the same field, type, method, etc. [Here's a workaround](http://stackoverflow.com/questions/1554112/multiple-annotations-of-the-same-type-on-one-element) – Sotirios Delimanolis Aug 14 '13 at 19:40
  • At least not until [JDK 8: Repeating Annotations](http://docs.oracle.com/javase/tutorial/java/annotations/repeating.html). Not sure if that would work for you, though. – Edwin Dalorzo Aug 14 '13 at 23:37

0 Answers0