Locale.getDisplayName() has the following syntax.
public final String getDisplayName()
In the following code shows how to use Locale.getDisplayName() method.
/*w ww .j av a2s . c o m*/ import java.util.Locale; public class Main { public static void main(String[] args) { Locale locale = new Locale("ENGLISH", "US"); System.out.println("Locale:" + locale); // print display name for locale System.out.println("Name:" + locale.getDisplayName()); } }
The code above generates the following result.