MessageFormat getLocale() method in Java with Example
The getLocale() method of java.text.MessageFormat class is used to get the locale used in this message format object.
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.
public Locale getLocale()
Paramter: This method does not take any argument as a parameter.
Return Value: This method returns the locale used in this message format object.
Below are the examples to illustrate the getLocale() method:
Locale is : en_US
Locale is : zh-hant-tw