Locale toString() Method in Java with Examples
The toString() method of Locale class in Java is used to return a string representation of this locale. Each element i.e., the language, country or the variant of the locale is separated by underbars
Parameters: This method does not take any parameters.
Return Value: This method returns a string representation of this locale.
Below programs illustrate the working of toString() method:
First Locale: nu_NO_NY The String: nu_NO_NY
First Locale: ar_SA The String: ar_SA