Locale.Builder build() method in Java with Examples
The build() method of java.util.Locale.Builder class in Java is used to build a Locale from the values specified to this Locale.Builder instance. This method returns a Locale instance after building it.
public Locale build()
Parameter: This method do not accept any parameter.
Return Type: This method returns an Locale instance with the values set to this Locale.Builder.
Exception: This method do not throw any exception.
Setting the Locale: fr_FR LocaleBuilder: java.util.Locale$Builder@232204a1 Building the Locale. Built Locale: fr_FR
Setting the Locale: en LocaleBuilder: java.util.Locale$Builder@232204a1 Building the Locale. Built Locale: en
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.