The valueOf() method of java.util.Locale.Category enum in Java is used to get the value of the specified constant of this Locale.Category enum type. This method takes the constant name as the parameter.
public static Locale.Category valueOf(String name)
Parameter: This method accepts a parameter name which is the constant name whose value is to be retrieved from the Locale.Category enum.
Return Type: This method returns an instance of this Locale.Category enum type with the value of the specified name.
Exception: This method do not throw any exception.
Locale.Category value of DISPLAY: DISPLAY
Locale.Category value of FORMAT: FORMAT
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.