모의 인터뷰-2
발행: (2026년 2월 9일 오전 11:47 GMT+9)
2 분 소요
원문: Dev.to
Source: Dev.to
인터뷰 질문
- 자기소개를 해주세요.
- 왜 기계공학에서 IT로 전향했나요?
- 기계공학이 처음 선택이었는데, 지금은 왜 IT 과정을 선택했나요?
- 왜 Java인가요?
- Java는 쉬운가요?
- 프로그램을 컴파일한다는 것은 무엇을 의미하나요?
- 실행 중에 무슨 일이 일어나나요?
System.out.println()을 사용하지 않고 출력을 만들려면 어떻게 해야 하나요?System.out.println()은 무엇을 출력하나요?- 제어 흐름 문이란 무엇인가요?
switch문이란 무엇인가요?
예제 1
switch (x) {
case 1:
System.out.print("One ");
case 2:
System.out.print("Two ");
case 3:
System.out.print("Three ");
default:
System.out.print("Default");
}
출력: Two Three Default
예제 2
switch (x) {
default:
System.out.print("Default ");
case 1:
System.out.print("One ");
case 2:
System.out.print("Two ");
}
출력: Default One Two
예제 3
switch (ch) {
case 'A':
System.out.println("A");
break;
case 65:
System.out.println("Sixty Five");
}
출력: A
('A' 케이스가 일치하고, 65는 int로 처리됩니다.)
예제 4 (switch 식)
String result = switch (day) {
case 1 -> "Monday";
case 2 -> "Tuesday";
case 3 -> "Wednesday";
default -> "Invalid";
};
System.out.println(result);
출력: Wednesday