我看到这行代码让我感到惊讶:
String res = "", currentLine;
while ((currentLine = rd.readLine()) != null) {
res+= currentLine;
}
Run Code Online (Sandbox Code Playgroud)
变量currentLine之前没有定义,奇怪的是它不会抛出任何错误?java在某种程度上使currentLine成为关键字吗?
谢谢!
事实上,currentLine 被定义为:
String res = "", currentLine;
Run Code Online (Sandbox Code Playgroud)
是相同的
String res = "";
String currentLine;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
37 次 |
| 最近记录: |