I’m trying to use a java locale in Scala. Using a constant like java.util.Locale.ENGLISH works well; however, java.util.Locale("en") complains:
error: object Locale is not a value
java.util.Locale("en")`
This seems related to this question, which suggests Locale doesn’t have a companion object. I’ve been reading a bit about this, but I still can’t figure out how one is to access the Locale class?
Do not forget to instantiate locale with new keyword, since it’s class: