AtomicLongArray.set(int i, long newValue) has the following syntax.
public final void set(int i, long newValue)
In the following code shows how to use AtomicLongArray.set(int i, long newValue) method.
import java.util.concurrent.atomic.AtomicLongArray; public class Main { public static void main(String[] argv) throws Exception { AtomicLongArray atomicLongArray = new AtomicLongArray(10); atomicLongArray.set(2,10L); System.out.println(atomicLongArray.get(0)); } }
The code above generates the following result.