Java API Tutorial - Java ResourceBundle.keySet()








Syntax

ResourceBundle.keySet() has the following syntax.

public Set < String > keySet()

Example

In the following code shows how to use ResourceBundle.keySet() method.

import java.util.Locale;
import java.util.ResourceBundle;
/* w ww .  jav a2s  . c o m*/
public class Main {

   public static void main(String[] args) {

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

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

      System.out.println(bundle.keySet());


   }
}