Code example for MessageFormat

Methods: formatsetLocale

     * @param key        the resourcebundle key 
     * @param parameters the parameter collection for the message 
     * @return the formated string 
    public String formatMessage(final String key, final Object[] parameters) {
        final MessageFormat format = new MessageFormat(getString(key));
        return format.format(parameters);
     * Returns the current locale for this resource bundle. 
     * @return the locale. 
    public Locale getLocale() {
        return locale;
Connect your IDE to all the code out there  Get Codota for Java