News:

Vote for WorldScape Classic here! If you vote once every hour, we'll gain more players!

Main Menu

Java tutorials: Series Tutorial Three: Java Annotations: Simple and useful.

Started by Tonypker, February 12, 2009, 11:53:12 PM

Previous topic - Next topic

Tonypker

I've just myself learned Annotations, so I'm hoping to pass it off to all of you!

QuoteAnnotations provide data about a program that is not part of the program itself. They have no direct effect on the operation of the code they annotate.

Now, Annotations have shit loads you can use them for. However I don't have all day, so here's a quick run down.

Annotations can easily give info to your JavaC, (Java c is the java compiler), even runtime processing.

Now, by conventions annotations may appear 1st, and will have named or un named values for it's elements.

Like for example, an author annotation.

Quote@Author(
   name = "Benjamin Franklin",
   date = "3/27/2003"
)
class MyClass() { }

Study more up on Annotations, and yes thank you Java for the example.
But as you can tell, already Annotations can be useful =)
Good luck!