Trying to print first token then every 5th after. has error not a statement
for (x = 0; x <= secretWord.length(); x + 5)
{
//Print
System.out.println(tokens[x]);
}
x
for-loop
. You need to assign it to the variable x
to make sense. Something like x = x + 5
x >= secretWord.length()
. It should be x <= secretWord.length();
else your loop will not pass the first check and will never execute.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.