Results 1 to 4 of 4
  1. #1
    ibmzz is offline Member
    Join Date
    Jan 2008
    Posts
    4
    Rep Power
    0

    Default why does a variable be bracketted in double @val@!Thank you

    I have download a open-source coded in Java from sourceforge websit,
    There are some source code like this

    public final static int CURRENT_OPTIMIZATION = @optimizationLevel@;
    public final static int OBJECT_ACTIVITY_TIMEOUT = @oectActivityTimeout@;
    if (@waitForTransactions@ == true) {
    setupShutdownHook();
    }
    why does a variable a bracked in double @,what does this mean? I have used java for coding few month, please give some advice,Thank you

  2. #2
    tim's Avatar
    tim
    tim is offline Senior Member
    Join Date
    Dec 2007
    Posts
    435
    Rep Power
    7

    Default

    Hello ibmzz. Welcome to the forums!

    I did a Google search and I found that the @ symbol, pronounced AT (Annotation Type) is used in Java for annotations. It serves as important documentation for the users of the code and the compiler. Read this interesting article that I found:
    Annotations (The Java™ Tutorials > Learning the Java Language > Classes and Objects)
    One of our members, roots, like to use annotations in his/her code. Maybe he/she can teach us a thing or two about them. :D
    Last edited by tim; 01-16-2008 at 12:25 PM.
    Eyes dwelling into the past are blind to what lies in the future. Step carefully.

  3. #3
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    757
    Rep Power
    8

    Default

    Just a guess, I think that this @varName@ notation is used in the code because the owner of the code want to find-and-replace the value "@varName@" later on using a build script such as ant.

  4. #4
    ibmzz is offline Member
    Join Date
    Jan 2008
    Posts
    4
    Rep Power
    0

    Default

    Mr. wsaryada,Thank you for you giving me some advices about the problem of @valname@.
    It is no question , this must be the ant compiling parameters, I am a junior for java coding. if I use ant utilities to build java programm even a very simple one just like "Hello world"(only have a input and output) the hello.java is writtinig like this:
    class Hello {
    public static void main(String args[]){
    String inVal = @inputVal@;
    System.out.println("This is the ant built reflect:"+inVal);
    }
    }
    How can i use Eclipse to built the program with the ant utilities?
    Would you mind giving me some advices about this?(my target is wo remove the syntex error in Eclipse IDE , and make it runnable )

Similar Threads

  1. Calculating sin of a double value
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-13-2008, 08:13 PM
  2. transforming double to int
    By AlejandroPenton in forum New To Java
    Replies: 2
    Last Post: 12-11-2007, 01:34 AM
  3. Getting smallest possible Double value
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-06-2007, 02:15 PM
  4. How to round a double?
    By Valeriano in forum New To Java
    Replies: 1
    Last Post: 05-31-2007, 03:50 PM
  5. Replies: 1
    Last Post: 05-20-2007, 11:19 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
  •