thread 썸네일형 리스트형 ThreadLocal 1. ThreadLocal 이란? Java.lang 패키지에서 제공하는 쓰레드 스코프 데이터 저장소 같은 쓰레드 scope 내에서 데이터 공유 사용방법은 간단하다. ThreadLocal를 객체를 선언하고 get(),set(),remove() 메소드를 이용하여 저장하면 된다. package com.ssafy; public class Test { static ThreadLocal threadLocal; public static void main(String[] args) throws Exception { threadLocal = new ThreadLocal(); Thread thread1 = new Thread(()-> { threadLocal.set("111"); System.out.println(thre.. 더보기 이전 1 다음