why java does not support multiple inheritance
Answer Posted / mythili pulluru
Java does not support a multiple inheritance because of following reason. for example class A
{
}
class B ExtendsA
{
//variables and methods
}
class c ExtendsA
{
//variables and methods
}
class B ExtendsA
{
//variables and methods
}
class D Extends B,C
{
//variables and methods
}
to compile this program it will give a compile time error because of class D felt in a confusion between B,C which class member to be a inherited(two class having same members) .to avoid this confusion java does not support multiple inheritance.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is temp in java?
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.
Give example to differentiate between call by value and call by reference.
Why do I need to declare the type of a variable in java?
Is arraylist an object in java?
How does finally block differ from finalize() method?
How do you declare an empty string?
What happens when heap memory is full?
Why stringbuilder is not thread safe in java?
How do you create a first line indent?
Why parameters should be passed by reference?
How to call one constructor from the other constructor ?
Why is stringbuffer faster than string?
Where local and global variables are stored?
What is the purpose of using the java bean?