Home Java Example Java Util Properties Properties file in Java
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

Properties file in Java

Advertisement
In this section, you will know about the properties file. The properties file is a simple text file.

Properties file in Java

     

In this section, you will know about the properties file. The properties file is a simple text file. Properties file contains keys and values for the specific key. Keys of properties file is always on left side and it's value is on the right side. Keys and values are separated by equal(=) sign. It is most important for the hash table. All the properties file are saved with the ".properties" extension. 

Properties class:
java.util.properties class extends the java.util.Hashtable class. This class is used to save the properties to the stream and read the properties from the stream. You can use the properties file to store the configurable values like database connection string, user name and password instead of hard coding into the program. 

Here, keys and values are specified in the properties file as follows:

#Mon Oct 23 15:16:21 GMT+05:30 2006
vk=Rosť.Net
RI=RoseIndia.Net
23 =Delhi
D =Deepak Kumar
Message= Software Development works

Advertisements

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: February 16, 2005

Ask Questions?    Discuss: Properties file in Java  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
Trupti
June 13, 2011
propery file

please elaborate the topic with an appropriate exaple.. how to create the property file.. which are the manditory attributes???
kavitha
December 15, 2011
Informative

Thank you.
DMCA.com