1
변수를 final로하지 않고 스레드 외부 변수에 액세스하는 방법은 무엇입니까?변수를 final로하지 않고 변수 외부 스레드에 액세스하는 방법
int x=0;
Thread test = new Thread(){
public void run(){
x=10+20+20; //i can't access this variable x without making it final, and if i make it.....
//final i can't assign value to it
}
};
test.start();
난이 자바라고 생각하고, 태그를 업데이트했습니다. – hmjd