Java Software Engineer Question:
Download Questions PDF

Explain me why aren’t you allowed to extend more than one class in Java but are allowed to implement multiple interfaces?

Answer:

Extending classes may cause ambiguity problems. On the other hand, in terms of interfaces, the single method implementation in one class can serve more than one interfaces.

Download Java Software Engineer Interview Questions And Answers PDF

Previous QuestionNext Question
As you know ArrayList, LinkedList, and Vector are all implementations of the List interface. Which of them is most efficient for adding and removing elements from the list? Explain your answer, including any other alternatives you may be aware of?Please explain what is the ThreadLocal class? How and why would you use it?