[单项选择题] 已知;1 String input=JoptionPane.showInputDialog ("Whats your name");2 int age=Integer.parseIntln(input);语句2所起的作用是 ( )
A.将字符串转化为整数
B.将整数转化为字符串
C.对字符串进行语法分析
D.对整数进行语法分析
参考答案:
A问题解析:
首先看语句2,如果你不知道Integer.parseIntln(input)的作用的话,可以看前面,把age定义为int型,而语句1的input是String型,由此可知语句2的作用是将字符串转化为整数。所以选A。

![[单项选择题] 已知;1 String input=JoptionPane.showInputDialog ("Whats your name");2 int age=Intege [单项选择题] 已知;1 String input=JoptionPane.showInputDialog ("Whats your name");2 int age=Intege](http://www.mshxw.com/aiimages/31/259283.png)
