我似乎在 netbeans 上使用此代码时遇到问题,来自 eclipse 的代码似乎没问题
for(int i = 0; i < shards.length();if
JSONObject obj = shards.getJSONObject(i);
try{
page = http.GetPageContentUta(url1,ip);
http.platform = (String)userClubList.getJSONObject(0).get("platform");
break;
}catch(Exception e){
System.out.println("Exception");
}
}
最佳答案
请学习语法,for loop in Java 。你写的内容是错误的。 来自 eclipse 看起来很好 不,没关系,语法错误是针对 Java 语言的,而不是针对任何 IDE 的。
for(int i = 0; i < shards.length();if
将其更改为:
for(int i = 0; i < shards.length(); i++) {
//Remaining if and other codes
}
关于java - If 语句在 For 循环中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19403737/