[Thread] 멀티쓰레드, 배열, 쓰레드 이용해서 int list 처리
아래는 쓰레드를 한번만 실행해서 푼 문제이고요. public static void main(String[] args) { /*다음 숫자 배열이 있습니다. 해당 배열 값을 짝수, 홀수 값을 각각 가져와서 배열로 처리합니다. 결과 : 짝수 : [2,6,10,22,42,50] 홀수 : [1,7,11,15,43,51] 멀티 쓰레드를 이용하여 출력합니다 */ cal ca = new cal(); ca.start(); } } class cal extends Thread { Integer arr[] = {1,2,6,7,10,11,15,22,42,43,50,51}; ArrayList even = new ArrayList(); ArrayList odd = new ArrayList(); public cal(Integer[]..
2022. 7. 13.