Java Locale equals() methodThe equals() method of Java Locale class returns true if this Locale is equal to another object. A Locale is deemed equal to another Locale with identical language, variant, country, extension, script, and unequal to all other objects. SyntaxParameterobj: It is the reference object with which to compare. ReturnIt returns the default locale for this instance of Java Virtual Machine Example 1Output: Locale1: company_JAVATPOINT Locales are equal: false Example 2Output: Locale1: company_JAVATPOINT Locale2: owner_SONOO Locale1 and Locale2 are equal: false Locale2 and Locale3 are equal: true Example 3Output: Locale1: company_JAVATPOINT Locale2: owner_SONOO Locale2 and Locale3 are equal: true Locale1 and Locale4 are equal: true Next TopicJava-locale-getavailablelocales-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India