Configuring an Application Using the Properties Class

The Properties class is an extension of Hashtable that restricts its keys and value objects to being strings. The intended use is to support a set of properties that can be easily read from and written to a stream, such as a text file. The System class uses this functionality to store system properties, but you can also use it to create and maintain your own property sets. A common use of this class is in maintaining a file of properties used to configure an application when it is launched.

You can create a new empty Properties object with the no-argument constructor:

public Properties()

You can also create a Properties object with a set of default properties. If the Properties object cannot ...

Get Special Edition Using Java 2 Standard Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.