abstract class and interface

1,An abstract class can have non-abstract methods; an interface can only have abstract methods.

2,An abstract class can have static methods; interface can only have non-static methods;

3,An abstract class can declare and use variable;an interface can't ;

4,A class can implement any number of interfaces,but can subclass at most one abstract class.

5,An abstract class can define constructors; in interface can not.

6,An abstract class can have methods whose access is public,internal ,protected,or private.Interface members implicitly have public access,and no access modifiers are allowed on interface member declarations.

你可能感兴趣的:(abstract class)