Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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@";
like image 271
SamTebbs33 Avatar asked Feb 01 '26 10:02

SamTebbs33


1 Answers

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.

like image 181
David Rabinowitz Avatar answered Feb 03 '26 04:02

David Rabinowitz