Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers | ||||
| ||||
Ans. Abstract classes can take care of that to a certain extent. Though they are little heavier than Interfaces but An abstract class with all abstract methods and no instance variables will be able to help with everything that currently an interface does. The only problem is that a class can only extend one class whereas it can implements multiple interfaces and that is the reason Interfaces were introduced in Java, i.e to get over the problem of multiple inheritance. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  interfaces expert | ||||
Related Questions | ||||
Differences between abstract class and interface ? | ||||
What are the different uses of Interfaces in Java ? | ||||
Why can't we have diamond problem with interfaces ? | ||||
Why do we need Thread class even in case we execute thread using runnable interface ? | ||||
What is the difference between List, Set and Map ? or What are the different Java Collections Interfaces ? | ||||
What are Marker Interfaces ? Name few Java marker interfaces ? | ||||
Can we declare interface methods as private ? | ||||
What is comparator interface used for ? | ||||
What is the use of runnable interface if we can always create a new thread using Thread class ? | ||||
Which of the following doesn't extend Collection interface ? | ||||