In this section, you will learn how to get all keys and it's values of the properties files in Java. Java provides the features to collection of all keys and values of the properties file. The properties files that can be used to large collections of information to be inserting in the properties files.
Here, you will get the all keys and values of the properties files with the help of this program. The program shows the keys and it's values when you run it. The following methods had been used by the program.
This method returns a set of keys, which contained in the object of the Properties method. The Properties files has the many keys then this method provides all keys.
This method provides the all keys of the properties files. Which stored in the Enumeration objects.
This is the interface which provided by the java.util package. It's object implements the series of elements and calls the nextElements method, which provides the series of elements. The keys and values of the Properties files which is enumerated by this interface and calls the hashtable which defines the keys and values of the properties files.
This method checks the Enumeration object has more elements or not and returns the true or false. It returns true, if the Enumeration object has more than one elements Otherwise, it return false.
This is the method to returns the next elements of the Enumeration, if the enumeration provides the more than one elements.
Here is the video tutorial of: "How to get key and value from properties file in Java?"
Here is the code of program:
Posted on: April 16, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles