Zero-based learning java ------ day18 ------ properties

1.Properties collection

1.1 Overview:

  Properties class represents a persistent set of properties. Properties can be saved or loaded from the stream in the stream. Each key in the list attribute and its corresponding value is a string

  A property list may contain a list of other properties as its "default values"; if not in the original list of attributes to search for the attribute value, the second search property list

  Because Properties inherits from Hashtable, the put and can be applied putAll methods Properties object. However, these methods are not recommended because they allow the caller to insert entries whose keys or values ​​are not a String. Instead, use the setProperty method. If the "unsafe" Properites objects (that contains a non- String key or value) method calls the store or save on, the call will fail. Similarly, if you call a method on the list propertyNames or "unsafe" Properites object, the call fails

Features Class 1.2 Properites

(1) The collection can not write a generic

(2) persistent set of properties, set of keys can be stored, it can be stored to the hard disk, U disk, etc.

(3) IO streams can be used in conjunction related art

Some methods of class 1.3 Properites

 

Guess you like

Origin www.cnblogs.com/jj1106/p/11410852.html