当前位置: 技术问答>java相关
scjp一道!!!!!!!!!!!!!!!!
来源: 互联网 发布时间:2015-03-05
本文导语: 2. public static void main(String args[]) { Integer b= new Integer(10); Add(b); System.out.println(b.intvalue()); } void Add(Integer b) { int I= b.intvalue(); I+=3; b= new Integer(I) } What will be printed out? Will print 13 Will print 10 Compilation Error in ...
2.
public static void main(String args[]) {
Integer b= new Integer(10);
Add(b);
System.out.println(b.intvalue());
}
void Add(Integer b)
{
int I= b.intvalue();
I+=3;
b= new Integer(I)
}
What will be printed out?
Will print 13
Will print 10
Compilation Error in Line 4 ?. implicit conversion to Integer to
String is not possible
Compilation Error in line 10 you can't re initialize a Wrapper
class
Exception in Line 10
Ans:b
这道题有问题
不可能通过的
add方法不是静态的不能再main里被调用.
对不对呀???
public static void main(String args[]) {
Integer b= new Integer(10);
Add(b);
System.out.println(b.intvalue());
}
void Add(Integer b)
{
int I= b.intvalue();
I+=3;
b= new Integer(I)
}
What will be printed out?
Will print 13
Will print 10
Compilation Error in Line 4 ?. implicit conversion to Integer to
String is not possible
Compilation Error in line 10 you can't re initialize a Wrapper
class
Exception in Line 10
Ans:b
这道题有问题
不可能通过的
add方法不是静态的不能再main里被调用.
对不对呀???
|
Compilation Error in Line 4 ?. implicit conversion to Integer to
String is not possible
String is not possible
|
对,应该是:comilation error in Line 3: non-static method called
|
答案也时常错误,没办法只有相信自己
|
是阿
编译无法通过