java - Why to use interface while we can make all methods abstract? -
this question has answer here:
- abstract class vs interface in java 14 answers
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
Post a Comment