Java ResourceBundle .getBundle (String baseName, Locale targetLocale, ResourceBundle .Control control)

Syntax

ResourceBundle.getBundle(String baseName, Locale targetLocale, ResourceBundle.Control control) has the following syntax.

public static final ResourceBundle getBundle(String baseName,    Locale targetLocale,    ResourceBundle.Control control)

Example

In the following code shows how to use ResourceBundle.getBundle(String baseName, Locale targetLocale, ResourceBundle.Control control) method.


import java.util.Locale;
import java.util.ResourceBundle;
import java.util.ResourceBundle.Control;
//from www .  ja  v a 2s. c  om
public class Main {

   public static void main(String[] args) {

      ResourceBundle.Control rbc = ResourceBundle.Control.getControl(Control.FORMAT_DEFAULT);

      ResourceBundle bundle = ResourceBundle.getBundle("hello", Locale.US, rbc);

      System.out.println(bundle.getString("hello"));

   }
}