Is multiple inheritance allowed in Java? Why ?

Answer Posted / shivaprasad

Multiple inheritance is not allowed in java because it creates
DIAMOND PROBLEM.
DIAMOND PROBLEM: Suppose classes B and C extend A and
class D extends to both B and C(multiple inheritance). Now,
if D calls a method in A then it does not know from which
class it has to inherit(either B or C). This is called
diamond problem.

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is recursion in java

601


How do you download stubs from Remote place?

1359


Define inheritance?

560


Realized?

1666


Give us the name of the list layoutmanagers in java?

523






What are the differences between wait() and sleep()?

541


What is a jagged array in java?

537


Which methods cannot be overridden in java?

540


Is arraylist ordered?

564


what is bmg file and how to create that files?what will it contailn?

1892


How to obtain a performance profile of java program

547


What is == in java?

568


What is static block?

593


Is singleton set an interval?

533


Draw a UML class diagram for the code fragment given below: public class StringApplet extends Applet { private Label sampleString; private Button showTheString; private ButtonHandler bHandler; private FlowLayout layout; public StringApplet() { sampleString = new Label(" "); showTheString = new Button (" Show the String"); bHandler = new ButtonHandler(); layout = new FlowLayout(); showTheString.addActionListener(bHandler); setLayout(layout); add(sampleString); add(showTheString); } class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e) { samplestring.setText("Good Morning"); } } } Note: The methods need not be indicated on the diagram.

1590