Java Scanner locale() method example

HQ ┬╗ Java Tutorial ┬╗ java.util ┬╗ Scanner ┬╗ locale() method example
Java Scanner locale() method example 2018-02-20T12:16:03+00:00

java.util.Scanner locale()

Description :

This java tutorial shows how to use the locale() method of Scanner class of java.util package. This method returns a Locale which the Scanner class is using.

Method Syntax :

public Pattern delimiter()

Parameter Input :

DataType Parameter Description

Method Returns :

This method simply returns this Scanner’s locale.

Compatibility Version :

Requires Java 1.5 and up

Exception :


Discussion :

The Scanner locale() method is helpful in determining the Locale being used by the scanner object. This is very important factor in dealing with primitive and during matching of regular expressions. Locale affects the Scanner object behaves.

Java Code Example :

This java example source code demonstrates the use of locale() method of Scanner class. Basically this sample prints locale specific information which the Scanner object has been using.

Sample Output :

Running the locale() method example source code of Scanner class will give you the following output

Exception Scenario :


Similar Method :

  • N/A

Suggested Reading List :

References :


Contact Info


Our Goal

JavaTutorialHQ aims to to be The Ultimate Guide on Java with hundreds of examples from basic to advance Topics.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.