모의 인터뷰-2

발행: (2026년 2월 9일 오전 11:47 GMT+9)
2 분 소요
원문: Dev.to

Source: Dev.to

인터뷰 질문

  1. 자기소개를 해주세요.
  2. 왜 기계공학에서 IT로 전향했나요?
  3. 기계공학이 처음 선택이었는데, 지금은 왜 IT 과정을 선택했나요?
  4. 왜 Java인가요?
  5. Java는 쉬운가요?
  6. 프로그램을 컴파일한다는 것은 무엇을 의미하나요?
  7. 실행 중에 무슨 일이 일어나나요?
  8. System.out.println()을 사용하지 않고 출력을 만들려면 어떻게 해야 하나요?
  9. System.out.println()은 무엇을 출력하나요?
  10. 제어 흐름 문이란 무엇인가요?
  11. 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' 케이스가 일치하고, 65int로 처리됩니다.)

예제 4 (switch 식)

String result = switch (day) {
    case 1 -> "Monday";
    case 2 -> "Tuesday";
    case 3 -> "Wednesday";
    default -> "Invalid";
};

System.out.println(result);

출력: Wednesday

0 조회
Back to Blog

관련 글

더 보기 »

Java 상속

Inheritance란 무엇인가? Inheritance는 하나의 class가 다른 class의 states와 behaviors를 가져오는 메커니즘이다. 이는 is‑a relationship를 나타내며, 의미는 ...

제네릭이란 무엇인가?

Generics는 Java 5에서 도입된 기능으로, 다양한 데이터 타입과 함께 작동하는 classes, interfaces 및 methods를 만들 수 있게 합니다. 이들은…