MessageFormat: format(String pattern, Object... arguments) : MessageFormat « java.text « Java by API






MessageFormat: format(String pattern, Object... arguments)

 
import java.text.MessageFormat;
import java.util.Date;

public class MainClass {
  public static void main(String args[]) throws Exception {
    Double kb = new Double(3.5);
    Date today = new Date();

    String pattern = "{0}K was deleted on {1}.";
    Object[] arguments = { kb, today };
    System.out.println(MessageFormat.format(pattern, arguments));
  }
}


           
         
  








Related examples in the same category

1.new MessageFormat(String pattern)
2.MessageFormat: setLocale(Locale locale)