directory: @code{hello-java}, @code{hello-java-awt}, @code{hello-java-swing}.
Now, to make use of the API and define a shorthand for @samp{getString},
-there are two idioms that you can choose from:
+there are three idioms that you can choose from:
@itemize @bullet
+@item
+(This one assumes Java 1.5 or newer.)
+In a unique class of your project, say @samp{Util}, define a static variable
+holding the @code{ResourceBundle} instance and the shorthand:
+
+@smallexample
+private static ResourceBundle myResources =
+ ResourceBundle.getBundle("domain-name");
+public static String _(String s) @{
+ return myResources.getString(s);
+@}
+@end smallexample
+
+All classes containing internationalized strings then contain
+
+@smallexample
+import static Util._;
+@end smallexample
+
+@noindent
+and the shorthand is used like this:
+
+@smallexample
+System.out.println(_("Operation completed."));
+@end smallexample
+
@item
In a unique class of your project, say @samp{Util}, define a static variable
holding the @code{ResourceBundle} instance:
@end smallexample
@end itemize
-Which of the two idioms you choose, will depend on whether copying two lines
-of codes into every class is more acceptable in your project than a class
-with a single-letter name.
+Which of the three idioms you choose, will depend on whether your project
+requires portability to Java versions prior to Java 1.5 and, if so, whether
+copying two lines of codes into every class is more acceptable in your project
+than a class with a single-letter name.
@node C#, gawk, Java, List of Programming Languages
@subsection C#