Java Currency getDisplayName() MethodThere are two types of getDisplayName methods. Java Currency getDisplayName() MethodThe getDisplayName() is the method of Java Currency class which is used to get the name of invoking currency for the default locale. SyntaxFollowing is the declaration of getDisplayName() method: Parameter
ReturnsThe getDisplayName() method is used to get the name of invoking currency for the default locale. ExceptionsNA Compatibility VersionJava 1.7 and above Example 1Output: INR is: Indian Rupee Example 2Output: Currency: USD Display name: US Dollar Currency: CNY Display name: Chinese Yuan Example 3Output: Name of given Currency is: Euro Example 4Output: Enter the Currency: INR Currency name is: Indian Rupee Java Currency getDisplayName(Locale locale) MethodThe getDisplayName(Locale locale) is the method of Java Currency class is used to get the name of invoking currency for the specified locale. SyntaxFollowing is the declaration of getDisplayName(Locale locale) method: Parameter
ReturnsThe getDisplayName(Locale locale) method returns the name of invoking currency for the specified locale. ExceptionsNullPointerException - If the locale is Null. Compatibility VersionJava 1.7 and above. Example 1Output: US Dollar Example 2Output: Currency: CNY French display name: yuan renminbi chinois Korean display name: 중국 위안 인민폐 Example 3Output: Indian Rupee rupia india Indian Rupee Example 4Output: Enter the Locale: IT Enter the Currency: INR Default locale is: Indian Rupee Specified locale is: Rupia Indiana Enter the locale: EN Enter the Currency: USD Default locale is: US Dollar Specified locale is: US Dollar Next TopicJava-currency-getinstance-method |