Why the detected Java search result is null

I am trying to get the language format on Windows, but when I change the display format to English (United States)or English (United Kingdom), the return value is from System.getProperty()equal null. For languages ​​other than English, I get the correct result.

I am using the following code:

System.out.println(System.getProperty("user.language.format"));
System.out.println(System.getProperty("user.country.format"));
+4
source share
1 answer

System properties and any properties in java are loaded at the beginning of your java application.

therefore, java will load the properties and put them in a hash table with the key value form.

if you make a call to a language format property, it takes the system language and looks for it in the hash table.

, null.

.

+5

All Articles