정보처리기사 2022년 2회 71번

From IT Wiki
Revision as of 01:01, 22 October 2022 by Maintenance script (talk | contribs) (Imported from text file)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

과목: 프로그래밍 언어 활용

문제[edit | edit source]

71. 다음 JAVA 프로그램이 실행되었을 때, 실행결과는?

<br />public class Rarr {<br />    static int[] marr() {<br />        int temp[]=new int[4];<br />        for(int i=0; i<temp.length; i++)<br />            temp[i]=i;<br />        return temp;<br />}<br />    public static void main(String[] args) {<br />        int iarr[];<br />        iarr=marr();<br />        for(int i=0; i<iarr.length; i++)<br />            System.out.print(iarr[i]+’’ ");<br />    }<br />}<br />
  • ① 1 2 3 4
  • ② 0 1 2 3
  • ③ 1 2 3
  • ④ 0 1 2

풀어보기[edit | edit source]

정답[edit | edit source]

  • 2번

해설[edit | edit source]

같이 보기[edit | edit source]