创建了Scanner对象scan,以下能正确获取输入数据的是( )
A: int s=scan.nextFloat();
B: float s=scan.nextDouble();
C: float s=scan.nextInt();
D: String s=scan.nextInt();
A: int s=scan.nextFloat();
B: float s=scan.nextDouble();
C: float s=scan.nextInt();
D: String s=scan.nextInt();
举一反三
- 创建了Scanner对象scan,以下能正确获取输入数据的是
- 语句“Scanner scan=new Scanner(System.in);”功能是()
- In Listening part, you'd better ____________ before starting? A: scan all the choices in this part B: scan all the choices in Section A C: scan all the choices in Section B D: scan all the choices in Section C
- 以下哪个语句是输入语句()。 A: Scanner scan = new Scanner(System.in); B: System.out.println("请输入用户名:"); C: msg.setUserName(scan.next());
- 已经通过下面的语句定义Scanner对象用于获取命令行的输入:Scanner s = new Scanner(System.in);下面的语句用于从键盘输入一个双精度数据保存在radius变量中,请选择正确的函数填空。double radius = s.________; A: nextLine( ) B: nextInt( ) C: nextFloat( ) D: nextDouble( )