So as seen the ' is missing and it doesnt substitue the parameter values also. It seems that by having '' (2quotes) in properties file: Prop.properties
the outputr comes as intended:
Can anyoone tell me whats wrong with the original code? any better workaround? I have modified as follows but not sure if thats the correct way to handle ' coming via properties file: Modified Test.java
There is nothing wrong; this is just how MessageFormat works. The single quote has a special meaning in the strings you pass to MessageFormat; it can be used for quoting other special characters, so you can include those characters literally in the format pattern.
See the API documentation of class MessageFormat for a detailed explanation. [ March 20, 2008: Message edited by: Jesper Young ]