bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/Java/Java Reference
Java•Java Reference

Java Scanner locale() Method

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind Java Scanner locale() Method?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

// ___ a scanner object Scanner myObj = new Scanner("A string to scan");
3Order

Put the learning moves in the order that makes the concept easiest to apply.

Show the locale that is currently being used by the scanner:
Definition and Usage
Java Scanner locale() Method

❮ Scanner Methods

Example

Show the locale that is currently being used by the scanner:

// Create a scanner object Scanner myObj = new Scanner("A string to scan");
// Find the locale System.out.println(myObj.locale());

Definition and Usage

The locale() method returns a Locale object describing the locale used when interpreting numbers. The locale specifies formatting such as which character is used as a decimal point and how digits in large numbers are grouped.

Syntax

public Locale locale()

Technical Details

Returns:A Locale object describing the locale used by the scanner.

❮ Scanner Methods

Previous

Java Scanner hasNextShort() Method

Next

Java Scanner next() Method