An annotation is a note that is made while reading any form of text. This may be as simple as underlining or highlighting passages. Annotated bibliographies give people a source that is useful to an author in constructing a paper or argument. Creating these comments, usually a few sentences long, establishes a summary for and expresses the relevance of each source prior to writing. The term also has a special meaning in a number of other fields.
In programming, annotations are used mainly for the purpose of expanding code documentation and comments. They are typically ignored when the code is compiled or executed.
e.g. A markup language (such as XML or HTML) is a modern system for annotating a text in a way that is syntactically distinguishable from that text.
A special case is the Java programming language, where annotations can be used as a special form of syntactic metadata in the source code. Classes, methods, variables, parameters and packages may be annotated. The annotations can be embedded in class files generated by the compiler and may be retained by the Java virtual machine and thus influence the run-time behaviour of an application. For details, see Java annotation.