The main advantage of using the properties file in Java is that in case the values in the properties file is changed it will be automatically reflected without having to recompile the java class. Thus it is mainly used to store information which is liable to change such as username and passwords. This makes the management of the application easy and efficient. Below is an example of the same: