String with variable parameters

Using string with parameters is very handy in case of Constants.

Java class in focus is: java.text.MessageFormat

 

Output will be

Welcome Mr. Nikhil to njoshi.com
Welcome Mrs. Tejashree to njoshi.com

Leave a Reply

Your email address will not be published. Required fields are marked *