Here you can find the source of getMessage(String key, Object... contents)
public static String getMessage(String key, Object... contents)
//package com.java2s; //License from project: Open Source License import java.text.MessageFormat; import java.util.Locale; import java.util.ResourceBundle; public class Main { private static ResourceBundle bundle = ResourceBundle.getBundle( "message", Locale.US); public static String getMessage(String key, Object... contents) { try {//from w ww . ja v a 2 s.c om String msg = bundle.getString(key); return MessageFormat.format(msg, contents); } catch (Exception e) { e.printStackTrace(); throw e; } } }