以下语句输出的结果是()String str = ”123”;int x = 4, y = 5;str = str + x + y;System.out.println(str);
12345
举一反三
- 智慧职教: 以下语句输出的结果是什么? String str = "123"; int x = 4, y = 5; str = x + y + str; System.out.println(str);
- 以下语句输出结果是( ) String str=”123”; int x=4,y=5; str=str+(x+y); System.out.println(str); A: 1239 B: 12345 C: 编译错误 D: 123+4+5
- 下列哪种操作不会抛出异常?( ) A: String str = "abc"; int i = Integer.parseInt(str); B: String str = null; str.toUperCase(); C: int x = 4; int y = 5; int z = x / y ; D: int[] num = new int[5]; num[5] = 5;
- 下列语句的执行结果是40。x = [4, 0, 7]y = str(x[0]) + str(x[1])print(y)
- 下列语句的执行结果是40。x=[4,0,7]y=str(x[0])+str(x[1])print(y)
内容
- 0
下面程序段的输出结果是 public class A{ public static void main(String args[]) { String str ="Hello,"; str=str+"Guys!"; System.out.println(str); } }
- 1
该String str = 6 > 8 ?”6不大于8”: “6小于8”; System.out.println(str); 输出结果是
- 2
Java中,String str=”123456789”,System.out.println(str.indexOf(“5”)),输出结果为( )。
- 3
public class ChangeStrDemo { public static void changeStr(String str){ str="welcome"; } public static void main(String[] args) { String str="home"; changeStr(str); System.out.println(str); } }给出程序的运行结果( )
- 4
以下程序的输出结果是()。int main( ){char * str="12345";cout <;<; strlen( str)<;<;"\t"<;<; sizeof(str);return 0;} A: 6 5 B: 5 6 C: 5 4 D: 5 5