Question from the Java test

What is the value of i after two threads execute the increment method?

Medium

If two threads execute the increment method, after the execution by the 2 threads, the value of i will be

private volatile int i;

public void increment() {
    i++;
}
Author: LoïcStatus: PublishedQuestion passed 305 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!