多选题:Java语言中,下面哪些代码片段会产生编译错误?
Java语言中,下面哪些代码片段会产生编译错误?
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";
String t = s - "directory";
答案:B D
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";
String t = s - "directory";
答案:B D