How exactly does Java Scanner parse double?

前端 未结 1 1237
陌清茗
陌清茗 2021-01-13 11:12

I\'m using a Windows 7 machine whose \"Control Panel\\Clock, Language, and Region\" is \"Denmark\"

According to the documentation for Scanner:

<
1条回答
  •  轮回少年
    2021-01-13 11:54

    There are two different Locale categories, one for display and one for format. The scanner uses Locale.getDefault(Locale.Category.FORMAT) but if you call Locale.getDefault() you get the locale for display. The setLocale(Locale) method sets both.

    0 讨论(0)
提交回复
热议问题