读取整数值
import java.util.Locale; import java.util.Scanner; public class Main { /** * N o w J a v a . c o m - 时 代 Java 提 供 **/ public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); keyboard.useLocale(Locale.UK); int val; double vald; double valf; System.out.print("Enter an integer please:"); val = keyboard.nextInt(); /* 来自 *时代Java - N o w J a v a . c o m*/ System.out.print("I read the following value:"); System.out.println(val); System.out.print("Enter a float please:"); valf = keyboard.nextFloat(); System.out.print("I read the following value:"); System.out.println(valf); System.out.