Properties file are often used in Java applications in the aim to store configuration parameters, internationalization and various informations. Each line of a properties file is a key/value entry. The key and the value are separated by the equal symbol « = ». In this tutorial, we will see how to write properties file in Java.

1 – Write properties file

Java offers the Properties class from the java.util package to read properties file. Below an example :We will write a properties file named config.properties

Config.properties content :

Note that use can store your properties in a XML file by using

instead of