1. Overview
In this tutorial, We'll be learning how to read from and write to the properties file in java.
Java API priovides a class
Properties which is part of
java.util package.
The Properties class stores the set of key, value pairs as properties. It internally stores all properties in a
Stream. The Properties can be saved to a stream or loaded from a stream. Each key and its corresponding value in the property list stored as a string.
public class Properties
extends Hashtable<Object,Object>
Properties inherit from
Hashtable, the put and putAll methods can be applied to a Properties object. Their use is strongly discouraged as they allow the caller to insert entries whose keys or values are not Strings. The
setProperty method should be used instead.