String str = "I'm not a {0}, age is {1,number,short}", height is {2,number,#.#};
String text="hello {0},hehe{1}"; MessageFormat mf=new MessageFormat(text); String value=MessageFormat.format(new Object[]{"adobe","goole"}); System.out.println(value);
// hello adobe ,hehe google