getKeys(): This method is available in java.util.ResourceBundle class of Java.
Syntax:
Enumeration<String> java.util.ResourceBundle.getKeys()
This method returns an enumeration of the keys.
Parameters: NA
Returns: an Enumeration of the keys contained in this ResourceBundle and its parent bundles.
Exceptions: NA
Approach
Java
import java.util.Enumeration;import java.util.Locale;import java.util.ResourceBundle;public class ResourceBundlegetKeys {public static void main(String[] args) {ResourceBundle bundle =ResourceBundle.getBundle("Hello", Locale.US);Enumeration<String> enumeration = bundle.getKeys();while (enumeration.hasMoreElements()) {System.out.print(enumeration.nextElement() + " ");}}}
Output:
Hello
No comments:
Post a Comment