PrepZone Logo
PrepZone
Back to Java

Java · Medium

Why doesn't Java support multiple inheritance with classes?

JavaOOP

Answer preview

Diamond problem — If class C extends both A and B, and both A and B have a method doWork(), the compiler cannot determine which version C should inherit — this creates ambiguity.…