A comment in this question said that numbers outside of java code are not called literals. Are literals only applicable in java code?
Can't we say the following number in a .properties file is a literal?
min-socre=20
A comment in this question said that numbers outside of java code are not called literals. Are literals only applicable in java code?
Can't we say the following number in a .properties file is a literal?
min-socre=20
Can't we say the following number in a .properties file is a literal?
How do you know it's a number? The concatenation of the characters '2' and '0' is interpretable as a representation of the number 20, but it's also interpretable as a representation of the string "20". There are surely other interpretations.
The term "literal" has a specific meaning in the context of Java code, and that particular meaning does not apply to other files. It does not necessarily apply even to source files written in other languages. For example, C has string literals, but integer constants. In more general contexts, the term "literal" is rarely used in this way at all, because the key characteristic differentiating a Java literal from other expressions of the same type either does not arise or is not important.
In one sense, of course you can describe the property value as a "literal". Inasmuch as .properties files are mostly a Java thing, most people to whom you might say that would probably understand you. But many of them would probably look at you oddly. That word usage doesn't really apply to the situation.