diff --git a/_raw/language-diamond.png b/_raw/language-diamond.png new file mode 100644 index 0000000..2f52bd9 Binary files /dev/null and b/_raw/language-diamond.png differ diff --git a/contents/language.md b/contents/language.md index e3534b7..2221875 100644 --- a/contents/language.md +++ b/contents/language.md @@ -423,7 +423,37 @@ public class SamsungSmartRemocon implements Remocon { } ``` +
+ + +---------------------------------------- + +
+
+ +---------------------------------------- + +### Java에서 다중상속을 지원하지 않는 이유는 무엇인가요. + +
+ 예비 답안 보기 (👈 Click) +
+

+ +

+ +- C++에서는 한 클래스에서 직간접적으로 하나 이상의 클래스를 상속할 수 있으며 이를 __다중상속__ 이라 한다. +- 그러나 두 부모 클래스(House, Office)가 한 클래스로(Place)부터 파생된 클래스인 경우 다중상속을 쓰면 애매한 상황이 발생한다. + 1. 상속받은 House, Office 클래스에 같은 이름의 멤버가 존재할 가능성 + 2. 하나의 클래스(Place)를 간접적으로 두 번 이상 상속받을 가능성이 있습니다. + 3. 가상 클래스가 아닌 기초 클래스를 다중 상속하면, 기초 클래스 타입의 포인터로 파생 클래스를 가리킬 수 없음 + +
+ +이러한 문제를 죽음의 다이아몬드(the Deadly Diamond of Death), 다이아몬드 문제(diamond problem)라고 한다. 다아아몬드 문제를 막기 위해서 다중상속을 막는다. + +
---------------------------------------- @@ -431,6 +461,8 @@ public class SamsungSmartRemocon implements Remocon {

+---------------------------------------- + ### 쓰레드세이프란? ``` @@ -562,4 +594,4 @@ public class SamsungSmartRemocon implements Remocon {

용감한 친구들 with 남송리 삼번지


- \ No newline at end of file + diff --git a/contents/source.md b/contents/source.md index 4240691..5012be5 100644 --- a/contents/source.md +++ b/contents/source.md @@ -12,11 +12,13 @@ - [Trello/ 면접준비](https://trello.com/b/MugMXwGi/%EB%A9%B4%EC%A0%91%EC%A4%80%EB%B9%84%F0%9F%91%91) - [ksundong / backend-interview-question](https://github.com/ksundong/backend-interview-question) - [Kirchhoff-/ Android-Interview-Questions](https://github.com/Kirchhoff-/Android-Interview-Questions) +- [boostcamp-ai-tech-4 / ai-tech-interview](https://github.com/boostcamp-ai-tech-4/ai-tech-interview) - [web-development-encyclopedia](https://github.com/parker1609/web-development-encyclopedia) - [Back-end-Developer-Interview-Questions](https://github.com/NESOY/Back-end-Developer-Interview-Questions) - [jwasham / coding-interview-university](https://github.com/jwasham/coding-interview-university) - [ClintJang / ios-swift-objc-questions-and-answers](https://github.com/ClintJang/ios-swift-objc-questions-and-answers) +
### 일반 질문