import java.util.Enumeration;
import java.util.ResourceBundle;
public class ResourceBundleTest {
public static void main(String[] args) {
ResourceBundle rb = ResourceBundle.getBundle("test.bundletest.mybundle");
Map map=new HashMap();
Enumeration <String> keys = rb.getKeys();
while (keys.hasMoreElements()) {
String key = keys.nextElement();
String value = rb.getString(key);
// Saving values in reverse manner
map.put(value,key);
System.out.println(key + ": " + value);
}
}
}
import java.util.ResourceBundle;
public class ResourceBundleTest {
public static void main(String[] args) {
ResourceBundle rb = ResourceBundle.getBundle("test.bundletest.mybundle");
Map map=new HashMap();
Enumeration <String> keys = rb.getKeys();
while (keys.hasMoreElements()) {
String key = keys.nextElement();
String value = rb.getString(key);
// Saving values in reverse manner
map.put(value,key);
System.out.println(key + ": " + value);
}
}
}
No comments:
Post a Comment