I have read the reply from those post(Why are interfaces useful?) and (Why use an interface when the class can directly implement the functions?), which is the similar question as my this post. But I still cannot understand it Why we use interface since we need to implement the method in our derived class?
I can understand that why we use ‘extends’, which is very good for code reuse since we do not need to write the method implementation if we extend a class and we do not want to override it. But for implement
a interface, we need to write the abstract function in the interface, in the class which implements, we need to write the implementations details. I do not think this does any benefit. Please explain why we even need the interface. Thanks.