Results 1 to 2 of 2

Thread: @ symbol?

  1. #1
    AgentSmith is offline Member
    Join Date
    Jun 2011
    Rep Power

    Default @ symbol?

    When reviewing example code, I sometimes see the '@' symbol used as a prefix. For example, reading up on Java Web Services I seen the following in the code example:



    public class MyProvider implements Provider<Source> {
    public Source invoke(Source source) {
    String replyElement = new String("<p>hello world</p>");
    StreamSource reply = new StreamSource(
    new StringReader(replyElement));
    return reply;

    Is the '@' symbol some pre-processing instruction?


  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Voorschoten, the Netherlands
    Blog Entries
    Rep Power


    It's an annotation. The Java compiler employs so called annotation processors on them which can do (almost) what they want. Some annotations are understood by the compiler itself. Consider them a sort of "meta language".

    kind regards,

    Build a wall around Donald Trump; I'll pay for it.

Similar Threads

  1. inserting symbol
    By droidus in forum New To Java
    Replies: 5
    Last Post: 02-11-2011, 07:54 PM
  2. '@' Symbol
    By AedonetLIRA in forum New To Java
    Replies: 5
    Last Post: 12-09-2010, 01:05 AM
  3. cannot find symbol
    By GabWit in forum New To Java
    Replies: 3
    Last Post: 01-25-2009, 12:13 AM
  4. Replies: 9
    Last Post: 10-18-2008, 08:26 PM
  5. Replies: 3
    Last Post: 05-01-2008, 08:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts