Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

ich lerne in der Corona-Krise selbst Java und bin jetzt über die Frage gestolpert, warum es in Java keine Mehrfachvererbung gibt und wie man es anhand eines Beispiels darstellen kann.
Ich weiß, dass es indirekte Mehrfachvererbung durch Interfaces gibt, aber wie kann man sowas anhand eines Beispiels darstellen und erklären warum es das nicht gibt? 

 

vor 8 Minuten schrieb Special List:

Gleiche Frage

Nur halt über 10 Jahre dazwischen... Zufall?

  • Autor

Das sollte anscheinend einen Zufall sein. 😅 

Ich frage mich auch : während es Mehrfachvererbung in C++ gibt, wieso ist es verboten in Java?   

Ich glaube, diese Frage gibt es schon seit lange. Und es wird manchmal noch im Vorstellungsgespräch gefragt. Leider habe ich noch keine passende Antwort dafür gefunden. 

 

Schlicht und ergreifend: Weil James Gosling (der Erfinder von Java) es nicht wollte.

Zitat

JAVA omits many rarely used, poorly understood, confusing features of C++ that in our experience bring more grief than benefit. This primarily consists of operator overloading (although it does have method overloading), multiple inheritance, and extensive automatic coercions.

(Zitat aus dem White Paper "Java: An Overview" von James Gosling)

Wie schon im verlinkten Thread zu lesen, existiert bei der Mehrfachvererbung das Diamond-Problem. In C++ wurde das Problem zwar mehr oder weniger gelöst aber es verkompliziert die Sprache. Also hat man es bei Java einfach weggelassen.

Bearbeitet von Whiz-zarD

vor 13 Stunden schrieb Geek347:

ich lerne in der Corona-Krise selbst Java

Interessant, dass man Projektleiter im JAVA-Umfeld sein kann ohne JAVA-Kenntnisse zu haben.

 

Ich bitte um Klärung - gerne per PN.

  • Gast hat dies Thema gesperrt
Gast
Dieses Thema ist für weitere Antworten geschlossen.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.