공식 기출문제

2017년 생활안전분야 9급 공개경쟁채용시험 컴퓨터일반 · 책형 · 15/20

컴퓨터일반

다음 Java 언어로 작성한 프로그램의 실행 결과는? public class Test { public static void main(String[] args) { int ar[] = {10, 20, 30, 40, 50}; int sum = 0, a = 100, b = 0; try { for(int i = 0; i < ar.length; i++) { sum += ar[i]; } System.out.println(sum); } catch (ArrayIndexOutOfBoundsException e) { System.out.println("Array Index Out Of Bounds Exception"); } try { float z = a / b; System.out.println(z); } catch (ArithmeticException e) { System.out.println("Arithmetic Exception"); } } }

공식 문제지와 최종정답을 문항별로 대조한 기출문제입니다. 공식 해설이 제공되지 않은 문항은 정답 근거만 표시합니다.