- Abstract classes can have constant, members, method and
method implementations, whereas interfaces can only have
may only contain method
signature and constant declarations(both static and
final)static final.
- Methods and members of an abstract class can be defined with any
visibility, whereas all methods of an interface must be defined as
public.
- When inheriting an abstract class, the child class must define the
abstract methods, whereas an interface can extend another interface and
methods don‘t have to be defined.
- A child class can only extend a single abstract (or any other) class,
whereas an interface can extend or a class can implement multiple other
interfaces.
- A child class can define abstract methods with the same or less
restrictive visibility, whereas a class implementing an interface must define
the methods with the exact same visibility.
abstract vs interface
原文:http://www.cnblogs.com/leetcode/p/3541199.html