将从以下代码片段打印什么? [英] What will be printed from the following code fragment?
本文介绍了将从以下代码片段打印什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
将从以下代码片段打印什么?
String str1 =Job;
String str2 = str1 + 1;
我尝试了什么:
什么都没有。我不明白这个....
What will be printed from the following code fragment?
String str1 = "Job";
String str2 = str1 + 1;
What I have tried:
nothing. i dont understand this....
推荐答案
没什么......,因为你甚至没有尝试在某处打印str2。
Nothing..., because you don't even try to print str2 somewhere.
String str1 = "Job";
String str2 = str1 + 1;
//you need this line:
System.out.println(str2);
尝试找出输出结果。
Try it to find out what will be an output.
引用:
从下面的代码片段打印什么?
What will be printed from the following code fragment?
有一种简单的方法可以知道:运行代码!
即使它不起作用,它也不是核武器,你的电脑也不会爆炸。
There is an easy way to know: run the code !
Even if it don't work, it is not nukes, your computer will not explode to your face.
这篇关于将从以下代码片段打印什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文