Scala Language Annotations Using an Annotation


Example

This sample annotation indicates that the following method is deprecated.

@deprecated
def anUnusedLegacyMethod(someArg: Any) =  {
  ...
}

This can also be equivalently written as:

@deprecated def anUnusedLegacyMethod(someArg: Any) =  {
  ...
}