ArrayIndexOutOfBoundsException : 0 이 발생하는 이유가 뭔가요?

조회수 2400회

... import java.util.Scanner;

public class Driver { public static void main(String[] args) {

    Sum sumObject = new Sum();

    int upper = Integer.parseInt(args[0]);
    Thread child = new Thread(new Summation(upper, sumObject));

    child.start();

    try {
        child.join(); 
        System.out.println("총합: " + sumObject.getSum());
    } catch (InterruptedException e) {
    }
}

} ...

자바 스레드 예제인 위 코드를 실행중인데 계속 오류가 뜨네요. 왜 저 오류가 뜨는건가요?

1 답변

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)