Java interface and abstract class issue

Posted by George2 on Stack Overflow See other posts from Stack Overflow or by George2
Published on 2010-05-15T14:07:02Z Indexed on 2010/05/15 14:14 UTC
Read the original article Hit count: 279

Filed under:
|
|
|

Hello everyone,

I am reading the book -- Hadoop: The Definitive Guide,

http://www.amazon.com/Hadoop-Definitive-Guide-Tom-White/dp/0596521979/ref=sr_1_1?ie=UTF8&s=books&qid=1273932107&sr=8-1

In chapter 2 (Page 25), it is mentioned "The new API favors abstract class over interfaces, since these are easier to evolve. For example, you can add a method (with a default implementation) to an abstract class without breaking old implementations of the class". What does it mean (especially what means "breaking old implementations of the class")? Appreciate if anyone could show me a sample why from this perspective abstract class is better than interface?

thanks in advance, George

© Stack Overflow or respective owner

Related posts about java

Related posts about interface