问题详情
下列代码的执行结果是( )。
int length="Hell0".length;
System.OUt.println(length);
A.5
B.2
C.10
D.6
A。【解析】字符串"Hello"的长度是5,java在计算字符串长度时只计算实际字符串长度。