Java Scanner locale() 方法
示例
显示扫描器当前使用的区域设置
// Create a scanner object
Scanner myObj = new Scanner("A string to scan");
// Find the locale
System.out.println(myObj.locale());
定义和用法
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.
语法
public Locale locale()
技术细节
返回 | A Locale object describing the locale used by the scanner. |
---|