Why is an interface be able to extend more than one interface but a class can’t extend more than one class?



Why is an interface be able to extend more than one interface but a class can’t extend more th..

Answer / Kavita Saxena

"Java allows interfaces to extend multiple interfaces because they are abstract contracts, specifying what methods must be implemented, but not how they should be implemented. This means that implementing multiple interfaces does not conflict with each other since the implementation is provided by separate classes. On the other hand, a class can only extend one superclass to avoid inheritance conflicts and maintain a clear hierarchy of classes."n

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is the functionality of Webserver?

2 Answers  


What are the benefits of java?

1 Answers  


What is classes in java?

1 Answers  


What are the operands of instanceof operator?

3 Answers  


I have a string like _a01_a02_a03_ and another string like _2_1.5_4_ as input.I want to extract a01,a02... to a string array and 2,1.5,etc to a double array with a01 corresponds to 2 and a02 to 1.5 etc. Need code in core java.. Can you do it?

1 Answers   Cognizant,


What is generic class?

1 Answers   Tech Mahindra,


What is operator?

3 Answers  


what is the replacement method of stop() of thread

8 Answers   IBM, TCS,


What is the file extension for java?

1 Answers  


What is CardLayout?

1 Answers   Infosys,


Is null an object in java?

1 Answers  


What are green threads in java?

1 Answers  


Categories