ResourceBundle.getObject(String key) has the following syntax.
public final Object getObject(String key)
In the following code shows how to use ResourceBundle.getObject(String key) method.
import java.util.Locale; import java.util.ResourceBundle; // w ww.j a v a2 s. 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")); } }