. Properties - Wikipedia. Properties Jump to : navigation, search. properties Filename extension. properties. properties is a file extension for files mainly used in Java related technologies to store the configurable parameters of an application. They can also be used for storing strings for Internationalization and localization ; these are known as Property Resource Bundles. Each parameter is stored as a pair of strings, one storing the name of the parameter ( called the key ), and the other storing the value. Contents 1 Format 2 Editing 3 Non-Java Uses and Exceptions 4 See also 5 References 6 External links Format Each line in a. properties file normally stores a single property. Several formats are possible for each line, including key = value, key = value, key : value, and key value. Note that single - quotes or double - quotes are considered part of the string. Trailing space is significant and presumed to be trimmed as required by the consumer. Comment lines in. properties files are denoted by the number sign ( # ) or the exclamation mark ( ! ) as the first non blank character, in which all remaining text on that line is ignored. The backwards slash is used to escape a character. An example of a properties file is provided below. # You are reading the ``. properties '' entry. ! The exclamation mark can also mark text as comments. # The key characters =, and : should be written with # a preceding backslash to ensure that they are properly loaded. # However, there is no need to precede the value characters =, and : by a backslash. website = https://en.wikipedia.org/ language = English # The backslash below tells the application to continue reading # the value onto the next line. message = Welcome to Wikipedia ! # Add spaces to the key key with spaces = This is the value that could be looked up with the key `` key with spaces ''. # Unicode tab : \u0009 # If you want your property to include a backslash, it should be escaped by another backslash path = c : wiki \templates # However, some editors will handle this automatically In the example above, website would be a key, and its corresponding value would be https://en.wikipedia.org/. While the number sign ( # ) and the exclamation mark ( ! ) marks text as comments, it has no effect when it is part of a property. Thus, the key message has the value Welcome to Wikipedia ! and not Welcome to Wikipedia. Note also that all of the whitespace in front of Wikipedia ! is excluded completely. The encoding of a. properties file is ISO - 8859 - 1, also known as Latin - 1. All non-Latin - 1 characters must be entered by using Unicode escape characters, e.g. \uHHHH where HHHH is a hexadecimal index of the character in the Unicode character set. This allows for using. properties files as resource bundles for localization. A non-Latin - 1 text file can be converted to a correct. properties file by using the native2ascii tool that is shipped with the JDK or by using a tool, such as po2prop, that manages the transformation from a bilingual localization format into. properties escaping. An alternative to using unicode escape characters for non-Latin - 1 character in ISO 8859 - 1 character encoded Java *. properties files is to use the JDK 's XML Properties file format which by default is UTF - 8 encoded, introduced starting with Java 1.5. Another alternative is to create custom control that provides custom encoding. In the forthcoming Java 9, following JDK Enhancement Proposal ( JEP ) 226, the default encoding for. properties files will be UTF - 8, and if an invalid UTF - 8 character is encountered it will revert to ISO - 8859 - 1. Editing Editing. properties files is done using any text editor such as those typically installed on various Operating Systems including Notepad on Windows or Emacs, Vim, etc. on Linux systems. Third - party tools are also available with additional functionality specific to editing. properties files such as : Data Validation Creating new keys Synchronization of key names Automatic bi-directional conversion of non-ASCII symbols to support non-Latin languages Integration with Eclipse Non-java uses and exceptions Apache Flex uses. properties files as well, but here they are UTF - 8 encoded. In Apache mod_jk 's uriworkermap. properties format, an exclamation mark ( `` ! '' ) denotes a Negation operator when used as the first non blank character in a line. Perl CPAN contains Config : : Properties to interface to a. properties file. See also XML and YAML are used by some for more complex configuration formats. References Jump up ^ Translate Toolkit 's po2prop converts native character encodings in a Gettext PO file into correctly escaped ascii without the need for native2ascii Jump up ^ Java XML Properties DTD Jump up ^ `` java - How to use UTF - 8 in resource properties with ResourceBundle - Stack Overflow ''. Archived from the original on 2015 - 03 - 25. Retrieved 2015 - 01 - 28. Jump up ^ Flex IResourceBundle reference Jump up ^ Apache mod_jk uriworkermap. properties reference Jump up ^ ( 1 ) External links java. util. Properties. load ( java. io. Reader ) - gives the precise semantics of well - formed Java property files java. util. PropertyResourceBundle - describes property resource bundles java. util. Properties - explains Java properties in a simple XML format. MultiProperties - It is an Eclipse plugin for editing multiple key - value based files with similar content. This kind of file format can be Properties for example in Java programming language, which is frequently used for backing a ResourceBundle. Bracket Properties - a refresh of the Properties concept while keeping the ubiquitous. properties file format intact. Java Properties Editor ( Application + Eclipse plugin ) - useful utility to view and to edit properties files in a whole project. DOKSoft Properties Editor Eclipse plugin - i18n tool for installing into Eclipse IDE. Message Editor - it manages i18n for Java application. It generates XML property files. It includes two stylesheets for. properties and. xml property generation at compile time ( Ant based. ) JLokalize - open source Java properties editor with reversal function and spell check Properties to XML conversion - Conversion of properties file to XML and vice versa. Config : : Properties - Perl CPAN. Jackson Properties module is a library that allows mapping Properties file contents into Java Objects and back, similar to how XML and JSON is commonly mapped Lokalise Developer - friendly translation and localisation tool that supports. properties files. Retrieved from `` https://en.wikipedia.org/w/index.php?title=.properties&oldid=812334025 '' Categories : Computer file formats Configuration files Java platform Java ( programming language ) Filename extensions Talk Contents About Wikipedia Deutsch Euskara Français 한국어 Magyar Português Русский Українська 中文 Edit links This page was last edited on 27 November 2017, at 07 : 49. Text is available under the Creative Commons Attribution - ShareAlike License ; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia ® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization. About Wikipedia

Question: why do we use properties file in java
Answer: storing the name of the parameter (called the key), and the other storing the value