20.假设有如下程序:
public class Demo {
public static void main(String args[]) {
String str = "" ;
for (int x = 0 ; x < 5 ; x ++) {
str += x ;
}
System.out.println(str) ;
}
}
最终的执行结果是什么?
A. 01234
B. 10
C. 14
D. 25
正确的答案是:A
字符串+=int 直接是按照字符串拼接处理