getExtensionKeys(): This method is available in java.util.Locale class of Java.
Syntax:
Set<Character> java.util.Locale.getExtensionKeys()
This method returns the set of extension keys associated with this locale, or the empty set if it has no extensions. The returned set is unmodifiable. The keys will all be lower-case.
Returns: The set of extension keys, or the empty set if this locale has no extensions.
For Example:
Locale locale = new Locale("en", "USA", "US")
locale.getExtensionKeys() = > It returns [].
Approach
Java
import java.util.Locale;public class LocalegetExtensionKeys {public static void main(String[] args) {Locale locale = new Locale("en", "USA", "US");System.out.println(locale.getExtensionKeys());}}
Output:
[]
No comments:
Post a Comment