Java tutorial
import java.util.ArrayList; import java.util.Arrays; import java.util.Enumeration; import java.util.Locale; import java.util.ResourceBundle; public class Main { public static void main(String[] args) { ResourceBundle bundle = ResourceBundle.getBundle("hello", Locale.US); Enumeration<String> keys = bundle.getKeys(); ArrayList<String> temp = new ArrayList<String>(); for (Enumeration<String> e = keys; keys.hasMoreElements();) { String key = e.nextElement(); if (key.startsWith("java2s")) { temp.add(key); } } String[] result = new String[temp.size()]; for (int i = 0; i < temp.size(); i++) { result[i] = bundle.getString(temp.get(i)); } System.out.println(Arrays.toString(result)); } }