And both reference the string object
The Java Application
main |
|
---|
String s1 = "A string object";
The next two statements illustrate how the references to the object can be removed:
main |
|
---|
• Execute the method's finalize method
• Reclaim the memory for re-use by the heap manager
In addition to the Locale class, we can also use resource bundles. They provide a way to customize the appearance based on the locale for data types other than numbers and dates. It is particularly useful when working with strings that change based on the locale.
For example, a GUI application will have different visual components whose text should differ when used in different parts of the world. In Spain, the text and currency should be displayed in Spanish. In China, Chinese characters and conventions should be used. The use of locales can simplify the process of adapting an application to different regions of the world.
[ 285 ]