Q:

Using the @ symbol in Strings

In several open source java projects, I have seen the use of the @ symbol in string variables, what does this do?
For example, I have seen it in an application that has its version number stored in a String instance, e.g:
public static final String APP_VERSION = "@VERSION@";

A:

It is used for the build scripts as marker to replace these string with build time information, such as the real version. The real information is usually taken from a property file or from timestamp.

A:

Putting @ in a string doesn't do anything special (with respect to Java). That example looks peculiar though. It's possible that the value is substituted with the real version number by a build script before compiling. It's also possible that the string is doing something else entirely.

