Ant files are scripts; properties files are buckets of strings.
The primary purpose of properties files is to serve as string containers for translatable text. The format strings typically used in resource bundles use an index-based system. When the string is translated, the order of the parameters can be changed in translated versions of the string without needing to change the Java code.
String what = "Hello";
String who = "Martin";
System.out.println(MessageFormat.format("{0}, {1}!", what, who));
System.out.println(MessageFormat.format("{1}, {0}!", what, who));
Output:
Hello, Martin!
Martin, Hello!
For use cases like this, it would not make sense to encapsulate the functionality in the Properties class because the strings usually need data from the application. The MessageFormat class can be used to perform the substitution.
This type of formatting should not be confused with the other formatting options as specified by Formatter:
System.out.format("%s, %s!%n", what, who);