프로그래밍 언어 활용난도 중상
1번 · 주관식 · 5점
다음 Java 프로그램의 실행 결과를 쓰시오.
public class Main {
static String[] words = new String[3];
static void printWords(String[] values, int size) {
for (int i = 1; i < size; i++) {
System.out.print(values[i - 1].equals(values[i]) ? "O" : "N");
}
for (String value : values) {
System.out.print(value);
}
}
public static void main(String[] args) {
words[0] = "A";
words[1] = "A";
words[2] = new String("A");
printWords(words, 3);
}
}