java - Why to use interface while we can make all methods abstract? -


this question has answer here:

in abstract class can make methods abstract can work interface, why use interface @ all?? 1 of reason come can implement multiple interface not extend multiple class.. there design or performance related thing involved??

you got answer. using interfaces can enforce multiple types of behaviours using classes not work you. example, can enforce class icomparable inumerable not possible if want classes.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -