黑马程序员技术交流社区

标题: 关于字符串的问题 [打印本页]

作者: zhangzhiyao    时间: 2015-8-27 21:51
标题: 关于字符串的问题
这个题选哪个答案,为什么?
下面的哪一个程序片断可能导致错误。 (   )
A.
  String s = "Gone with the wind";
  String t = " good ";
  String k = s + t;
B.
  String s = "Gone with the wind";
  String t;
  t = s[3] + "one";
C.
  String s = "Gone with the wind";
  String standard = s.toUpperCase();
D.
  String s = "home directory";
  s = s + "directory";





欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2