AtomicLong atomicLong = new AtomicLong(100);
atomicLong.set(200);In this example, the set() method is called on the AtomicLong object and the value is updated to 200. Since AtomicLong is thread-safe, it ensures that the value is updated atomically and there are no race conditions. Hence, AtomicLong class belongs to java.util.concurrent.atomic package.