[英]Trying to make it every 5th token
Trying to print first token then every 5th after. 尝试先打印令牌,然后再打印第5个令牌。 has error not a statement
有错误而不是陈述
for (x = 0; x <= secretWord.length(); x + 5)
{
//Print
System.out.println(tokens[x]);
}
x
x
for-loop
. for-loop
悬挂表达式。 You need to assign it to the variable x
to make sense. x
才有意义。 Something like x = x + 5
x = x + 5
类的东西 x >= secretWord.length()
. x >= secretWord.length()
。 It should be x <= secretWord.length();
x <= secretWord.length();
else your loop will not pass the first check and will never execute.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.