웹사이트 검색

OOPS 인터뷰 질문 및 답변


OOPS 인터뷰 질문과 답변에 오신 것을 환영합니다. Java, C++ 및 Python과 같은 많은 객체 지향 프로그래밍 언어가 있습니다. 이러한 프로그래밍 언어에 대한 인터뷰를 하게 될 경우 OOPS 개념에 대한 명확한 아이디어를 갖는 것이 매우 중요합니다. 그래서 OOPS 면접 질문을 여러분과 공유하고 그에 대한 자세한 답변을 제공하려고 생각했습니다.

OOPS 인터뷰 질문

죄송합니다 무엇입니까?\n객체 지향 프로그래밍 시스템은 실제 객체를 기반으로 프로그램을 작성하는 프로그래밍 기술입니다. 개체의 상태 및 동작은 멤버 변수 및 메서드로 표시됩니다. OOPS 프로그래밍 프로그램은 동작과 논리가 아닌 개체와 데이터를 중심으로 구성됩니다.\n\n\nOOPS 개념의 장점은 무엇입니까? OOPS 프로그래밍의 주요 이점은 다음과 같습니다.\n\n단순성: OOPS 프로그래밍 개체는 실제 개체를 모델링하므로 복잡성이 감소하고 프로그램 구조가 명확합니다.\n모듈성: 각 개체는 내부 작업이 시스템의 다른 부분과 분리된 별도의 엔터티를 형성합니다.\n수정 가능성(Modifiability): OO 프로그램의 데이터 표현이나 절차를 약간만 변경하는 것은 쉽습니다. 클래스 내부의 변경 사항은 프로그램의 다른 부분에 영향을 미치지 않습니다. 외부 세계가 클래스에 대해 갖는 유일한 공용 인터페이스는 메서드를 사용하기 때문입니다.\n확장성: 새로운 기능을 추가하거나 변화하는 운영 환경에 대응하는 것은 몇 가지 새로운 개체를 도입하고 기존 개체를 수정하여 해결할 수 있습니다.\n유지 관리 가능성: 개체를 별도로 유지 관리할 수 있으므로 문제를 쉽게 찾고 수정할 수 있습니다.\n재사용성: 개체는 다른 프로그램에서 재사용할 수 있습니다.

절차적 프로그래밍과 OOPS의 차이점은 무엇입니까?

  1. 절차적 언어는 기능을 기반으로 하지만 객체 지향 언어는 실제 객체를 기반으로 합니다.
  2. 절차적 언어는 함수 실행의 순서를 중시하지만 객체 지향 언어는 객체의 상태와 동작을 중시합니다.
  3. 절차적 언어는 데이터를 전체 프로그램에 노출하지만 객체 지향 언어는 데이터를 캡슐화합니다.
  4. 절차적 언어는 하향식 프로그래밍 패러다임을 따르지만 객체 지향 언어는 상향식 프로그래밍 패러다임을 따릅니다.
  5. 절차적 언어는 본질적으로 복잡하므로 수정, 확장 및 유지 관리가 어렵지만 객체 지향 언어는 본질적으로 덜 복잡하므로 수정, 확장 및 유지 관리가 더 쉽습니다.
  6. 절차적 언어는 코드 재사용 범위가 적지만 객체 지향 언어는 코드 재사용 범위가 더 넓습니다.

OOPS의 핵심 개념은 무엇입니까?

OOPS 핵심 개념은 다음과 같습니다.

  1. 추상화
  2. 캡슐화
  3. 다형성
  4. 상속
  5. 구성
  6. 협회
  7. 집계

추상화란 무엇입니까?

추상화는 실세계 객체의 구조를 구성하는 OOPS 개념입니다. 이 구성 중에는 일반적인 상태와 동작만 취해지고 보다 구체적인 상태와 동작은 구현자를 위해 남겨둡니다.

캡슐화란 무엇입니까?

캡슐화는 개체와 해당 멤버 변수 및 메서드의 권한 및 제한을 만들고 정의하는 OOPS 개념입니다. 개념을 설명하는 아주 간단한 예는 클래스의 멤버 변수를 비공개로 만들고 공용 getter 및 setter 메서드를 제공하는 것입니다. Java는 public, protected, no modifier 및 private의 네 가지 유형의 액세스 수준 수정자를 제공합니다.

추상화와 캡슐화의 차이점은 무엇입니까?

  1. "구현이 아닌 인터페이스에 대한 프로그램\은 추상화의 원칙이며 "변하는 것을 캡슐화\는 캡슐화의 OO 원칙입니다.
  2. 추상화는 클래스의 일반적인 구조를 제공하고 세부 사항은 구현자에게 맡깁니다. 캡슐화는 개체와 해당 멤버 변수 및 메서드의 권한과 제한을 만들고 정의하는 것입니다.
  3. 추상화는 인터페이스와 추상 클래스를 사용하여 Java로 구현되는 반면 캡슐화는 4가지 유형의 액세스 수준 수정자(공용, 보호, 수정자 없음 및 개인)를 사용하여 구현됩니다.

다형성이란 무엇입니까?

다형성은 다양한 형태의 무언가가 발생하는 것입니다. Java는 다형성 참조 변수, 다형성 메서드, 다형성 반환 유형 및 다형성 인수 유형과 같은 다양한 형태의 다형성을 지원합니다.

상속이란 무엇입니까?

하위 클래스는 상위 클래스의 상태와 동작을 상속할 수 있으며 이를 상속이라고 합니다.

다중 상속이란 무엇입니까?

A child class inheriting states and behaviors from multiple parent classes is known as multiple inheritance.

상속에서 다이아몬드 문제는 무엇입니까?

In case of multiple inheritance, suppose class A has two subclasses B and C, and a class D has two super classes B and C.If a method present in A is overridden by both B and C but not by D then from which class D will inherit that method B or C? This problem is known as diamond problem.

Java가 다중 상속을 지원하지 않는 이유는 무엇입니까?

Java was designed to be a simple language and multiple inheritance introduces complexities like diamond problem. Inheriting states or behaviors from two different type of classes is a case which in reality very rare and it can be achieved easily through an object association.

정적 바인딩 및 동적 바인딩이란 무엇입니까?

Static or early binding is resolved at compile time. Method overloading is an example of static binding. Dynamic or late or virtual binding is resolved at run time. Method overriding is an example of dynamic binding.

IS-A 및 HAS-A 관계의 의미는 무엇입니까?

"IS-A" relationship implies inheritance. A sub class object is said to have "IS-A" relationship with the super class or interface. If class A extends B then A "IS-A" B. It is transitive, that is, if class A extends B and class B extends C then A "IS-A" C. The "instanceof" operator in java determines the "IS-A" relationship. When a class A has a member reference variable of type B then A "HAS-A" B. It is also known as Aggregation.

협회 란 무엇입니까?

Association is a relationship between two objects with multiplicity.

집계란 무엇입니까?

Aggregation is also known as "HAS-A" relationship. When class Car has a member reference variable of type Wheel then the relationship between the classes Car and Wheel is known as Aggregation. Aggregation can be understood as "whole to its parts" relationship. Car is the whole and Wheel is part. Wheel can exist without the Car. Aggregation is a weak association.

구성이란 무엇입니까?

Composition is a special form of Aggregation where the part cannot exist without the whole. Composition is a strong Association. Composition relationship is represented like aggregation with one difference that the diamond shape is filled.

종속성이란 무엇입니까?

When one class depends on another because it uses that at some point in time then this relationship is known as Dependency. One class depends on another if the independent class is a parameter variable or local variable of a method of the dependent class. A Dependency is drawn as a dotted line from the dependent class to the independent class with an open arrowhead pointing to the independent class.

연관과 종속성의 차이점은 무엇입니까?

The main difference between Association and Dependency is in case of Association one class has an attribute or member variable of the other class type but in case of Dependency a method takes an argument of the other class type or a method has a local variable of the other class type.

수업이란 무엇입니까?

A class is the specification or template of an object.

객체란 무엇입니까?

Object is instance of class.