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

Syntax

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

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

Example

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


/*from   w  ww . j  a  va 2  s.  c  o  m*/

import java.util.ResourceBundle;
import java.util.ResourceBundle.Control;

public class Main {

   public static void main(String[] args) {

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

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

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

   }
}