B
B
BitNeBolt2019-05-16 16:45:34
Java
BitNeBolt, 2019-05-16 16:45:34

Is it possible to create a cycle like this, the error is "not a statement"?

Just started learning Java.
Returns "not a statement".
What to do?

int i = 0;
for (i; i < 10; i++){
    System.out.println(i);
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2019-05-16
@BitNeBolt

for (; i < 10; i++) {

B
BorLaze, 2019-05-16
@BorLaze

Can. But not necessary.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question