Java Scanner locale() MethodThe locale() method of Java Scanner class is used to get a Locale which the Scanner class is using. SyntaxFollowing is the declaration of locale() method: ParameterThis method does not accept any parameter. ReturnsThe locale() method returns this scanner's locale. ExceptionsNA Compatibility VersionJava 1.5 and above Example 1Output: Scan string: Hello JavaTpoint! 12 + 13.0 = 25 Current Locale: en_IN Example 2Output: Enter Your Name: JavaTpoint.com Name: JavaTpoint.com Current Locale: en_IN Example 3Output: Locale:en_IN Diplay name:English (India) Display country:India Next TopicJava-scanner-match-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