September 2005
Beginner
576 pages
13h 6m
English
Java programs are more versatile when they can be configured using command-line arguments, as you have demonstrated in several applications created in preceding hours.
The java.util package includes a class, Properties, that enables configuration settings to be loaded from a file.
The file can be read like other file sources in Java:
Create a File object that represents the file
Create a FileInputStream object from that File object
Call load() to retrieve the properties from that input stream
A properties file has a set of property names followed by an equals sign (“=”) and their values. Here's an example:
username=lepton lastCommand=open database windowSize=32
Each property has its own line, so this ...
Read now
Unlock full access