Java API Tutorial - Java ResourceBundle .getBundle (String baseName)








Syntax

ResourceBundle.getBundle(String baseName) has the following syntax.

public static final ResourceBundle getBundle(String baseName)

Example

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

/*  w w  w . j a v a  2s .  c  o  m*/
import java.util.ResourceBundle;

public class Main {

   public static void main(String[] args) {

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

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

   }
}