Java API Tutorial - Java ResourceBundle .getString (String key)








Syntax

ResourceBundle.getString(String key) has the following syntax.

public final String getString(String key)

Example

In the following code shows how to use ResourceBundle.getString(String key) method.

//  www .  j av  a  2s  .  c  o  m
import java.util.Locale;
import java.util.ResourceBundle;

public class Main {

   public static void main(String[] args) {

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

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

   }
}