package linguagem;
import java.util.*;
public class Linguagem {
public static void main(String[] args) {
Locale locale = new Locale("PORTUGUESE", "PT");
System.out.println("Linguagem: " + locale.getDefault());
}
}
Withlocale.getDefault()
returningen_US
,itbecomesunnecessarytouseLocale("PORTUGUESE", "PT")
, however, if I leave only Locale()
, NetBeans returns me error.
And if I leave the string empty: Locale("", "")
, it works, but it looks like gambiarra.
I wanted to know if there is another way to write this code, without having to leave the variable empty.