Thursday, October 23, 2025
HomeLanguagesJavaLocale.FilteringMode valueOf() method in Java with Examples

Locale.FilteringMode valueOf() method in Java with Examples

The valueOf() method of java.util.Locale.FilteringMode enum in Java is used to get the value of the specified constant of this Locale.FilteringMode enum type. This method takes the constant name as the parameter.

Syntax:

public static Locale.FilteringMode valueOf(String name)

Parameter: This method accepts a parameter name which is the constant name whose value is to be retrieved from the Locale.FilteringMode enum.

Return Type: This method returns an instance of this Locale.FilteringMode enum type with the value of the specified name.

Exception: This method do not throw any exception.

Program 1:




// Java program to demonstrate
// the above method
  
import java.util.*;
import java.util.Locale.*;
  
public class LocaleFilteringModeDemo {
    public static void main(String[] args)
    {
  
        String name
            = "AUTOSELECT_FILTERING";
  
        // Getting the constant
        // of Locale.FilteringMode
        System.out.println("Locale.FilteringMode"
                           + " value of "
                           + name + ": "
                           + Locale.FilteringMode
                                 .valueOf(name));
    }
}


Output:

Locale.FilteringMode value of AUTOSELECT_FILTERING: AUTOSELECT_FILTERING

Program 2:




// Java program to demonstrate
// the above method
  
import java.util.*;
import java.util.Locale.*;
  
public class LocaleFilteringModeDemo {
    public static void main(String[] args)
    {
  
        String name
            = "EXTENDED_FILTERING";
  
        // Getting the constant
        // of Locale.FilteringMode
        System.out.println("Locale.FilteringMode"
                           + " value of "
                           + name + ": "
                           + Locale.FilteringMode
                                 .valueOf(name));
    }
}


Output:

Locale.FilteringMode value of EXTENDED_FILTERING: EXTENDED_FILTERING

Reference: https://docs.oracle.com/javase/9/docs/api/java/util/Locale.FilteringMode.html#valueOf-java.lang.String-

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS