Chapter 18: java.util Part 2: More Utility Classes 553
System.out.println("String for StopText key: " +
rd.getString("StopText"));
System.out.println("String for StartText key: " +
rd.getString("StartText"));
// Load the German bundle.
rd = ResourceBundle.getBundle("SampleRB", Locale.GERMAN);
System.out.println("\nGerman version: ");
System.out.println("String for Title key : " +
rd.getString("title"));
System.out.println("String for StopText key: " +
rd.getString("StopText"));
System.out.println("String for StartText key: " +
rd.getString("StartText"));
}
}
The output from the program is shown here:
English version:
String for Title key : My Program
String for StopText key: Stop
String for StartText key: Start
German version:
String for Title key : Mein Programm
String for StopText key: Anschlag
String for StartText key: Anfang
Miscellaneous Utility Classes and Interfaces
In addition to the classes already discussed,java.utilincludes the following classes:
EventListenerProxy Extends theEventListenerclass to allow additional parameters. See Chapter 22 for a
discussion of event listeners.
EventObject The superclass for all event classes. Events are discussed in Chapter 22.
FormattableFlags Defines formatting flags that are used with theFormattableinter face.
Proper tyPermission Manages proper ty permissions.
Ser viceLoader Provides a means of finding ser vice providers. (Added by Java SE 6.)
UUID Encapsulates and manages Universally Unique Identifiers (UUIDs).
The following interfaces are also packaged injava.util:
EventListener Indicates that a class is an event listener. Events are discussed in Chapter 22.
Formattable Enables a class to provide custom formatting.