How does ZoneId and ZoneOffset behave in multithreaded code?

ZoneId and ZoneOffset in Java are crucial for managing time zones and offsets in date-time APIs. When used in multithreaded applications, they are thread-safe and immutable, making them suitable for concurrent usage without additional synchronization.
ZoneId, ZoneOffset, multithreaded code, Java, date-time APIs, thread-safe, immutable

    import java.time.ZoneId;
    import java.time.ZoneOffset;

    public class TimeZoneExample {
        public static void main(String[] args) {
            Runnable task1 = () -> {
                ZoneId zoneId1 = ZoneId.of("America/New_York");
                System.out.println("Task 1 - ZoneId: " + zoneId1);
            };

            Runnable task2 = () -> {
                ZoneOffset zoneOffset2 = ZoneOffset.of("-05:00");
                System.out.println("Task 2 - ZoneOffset: " + zoneOffset2);
            };

            Thread thread1 = new Thread(task1);
            Thread thread2 = new Thread(task2);

            thread1.start();
            thread2.start();
        }
    }
    

ZoneId ZoneOffset multithreaded code Java date-time APIs thread-safe immutable