试题与答案

下列程序中,实现将封装数据类型Integer和基本数据类型int之间的转换,以及In

题型:问答题

题目:

下列程序中,实现将封装数据类型Integer和基本数据类型int之间的转换,以及Integer,int类型和String类型之间的转换。请将程序补充完整。
程序运行结果如下:
123
456
456
public class ex7_1
public static void main(String[]args)
Integer intObj;
int n;
String s;
intObj = new Integer(123);
n=intObj.__________;
System.out.printin(Integer.toString(n));
s=new String("456");
intObj=Integer._________;
System.out.println(intObj.__________);
n=Integer.parseInt(s);
System.out.println(Integer.toString(n));

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0704/808a8bf6fea5fa14244262edbfaaa827.html

下面是错误答案,用来干扰机器的。

参考答案:A, B, C

试题推荐
微信公众账号搜索答案