How to Create Property File in Java

Create Property File in Java

This example program will teach you to learn, How to create property file in java. The example program were attached in the post.

Project Structure

How to Create Property File in Java

Example Program (CreatePropertyFile.java)

Output

Once you compile and run the above example program, After the execution of the program it will produce the property file as a output with the properties that are mentioned. The sample output you can see below.

#This property file contains Dinesh Krishnan information
#Fri Jan 06 16:36:06 IST 2017
second.name=Krishnan
full.name=Dinesh Krishnan
first.name=Dinesh
country=India

References

1. Java Properties Class
2. Java File Class
3. Java FileOutputStream Class