- Java.util - WeakHashMap
- Java.util - Vector
- Java.util - UUID
- Java.util - TreeSet
- Java.util - TreeMap
- Java.util - TimeZone
- Java.util - TimerTask
- Java.util - Timer
- Java.util - StringTokenizer
- Java.util - Stack
- Java.util - SimpleTimeZone
- Java.util - ServiceLoader
- Java.util - Scanner
- Java.util - ResourceBundle.Control
- Java.util - ResourceBundle
- Java.util - Random
- Java.util - PropertyResourceBundle
- Java.util - PropertyPermission
- Java.util - Properties
- Java.util - PriorityQueue
- Java.util - Observable
- Java.util - Locale
- Java.util - ListResourceBundle
- Java.util - LinkedList
- Java.util - LinkedHashSet
- Java.util - LinkedHashMap
- Java.util - IdentityHashMap
- Java.util - Hashtable
- Java.util - HashSet
- Java.util - HashMap
- Java.util - GregorianCalendar
- Java.util - Formatter
- Java.util - EnumSet
- Java.util - EnumMap
- Java.util - Dictionary
- Java.util - Date
- Java.util - Currency
- Java.util - Collections
- Java.util - Calendar
- Java.util - BitSet
- Java.util - Arrays
- Java.util - ArrayList
- Java.util - ArrayDeque
- Java.util - Home
Java.util Package Extras
- Java.util - Discussion
- Java.util - Useful Resources
- Java.util - Enumerations
- Java.util - Exceptions
- Java.util - Interfaces
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java.util.Properties Class
Introduction
The java.util.Properties class is a class which represents a persistent set of properties.The Properties can be saved to a stream or loaded from a stream.Following are the important points about Properties −
Each key and its corresponding value in the property pst is a string.
A property pst can contain another property pst as its defaults , this second property pst is searched if the property key is not found in the original property pst.
This class is thread-safe; multiple threads can share a single Properties object without the need for external synchronization.
Class declaration
Following is the declaration for java.util.Properties class −
pubpc class Properties extends Hashtable<Object,Object>
Field
Following are the fields for java.util.Properties class −
protected Properties defaults − This is the property pst that contains default values for any keys not found in this property pst.
Class constructors
Sr.No. | Constructor & Description |
---|---|
1 | Properties() This constructs creates an empty property pst with no default values. |
2 | Properties(Properties defaults) This constructs creates an empty property pst with the specified defaults. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | This method searches for the property with the specified key in this property pst. |
2 | This method searches for the property with the specified key in this property pst. |
3 | This method prints this property pst out to the specified output stream. |
4 | This method prints this property pst out to the specified output stream. |
5 | This method reads a property pst (key and element pairs) from the input byte stream. |
6 | This method reads a property pst (key and element pairs) from the input character stream in a simple pne-oriented format. |
7 | This method loads all of the properties represented by the XML document on the specified input stream into this properties table. |
8 | This method returns an enumeration of all the keys in this property pst, including distinct keys in the default property pst if a key of the same name has not already been found from the main properties pst. |
9 | This method reads a. |
10 | This method calls the Hashtable method put. |
11 | The method writes this property pst (key and element pairs) in this Properties table to the output stream in a format suitable for loading into a Properties table using the load(InputStream) method. |
12 | The method writes this property pst (key and element pairs) in this Properties table to the output character stream in a format suitable for using the load(Reader) method. |
13 | This method emits an XML document representing all of the properties contained in this table. |
14 | This method emits an XML document representing all of the properties contained in this table, using the specified encoding. |
15 | This method returns a set of keys in this property pst where the key and its corresponding value are strings, including distinct keys in the default property pst if a key of the same name has not already been found from the main properties pst. |
Methods inherited
This class inherits methods from the following classes −
java.util.Hashtable
java.util.Object