abstract class and interface
2011-03-17 14:52
330 查看
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.
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.
相关文章推荐
- Interface And Abstract Class
- Different Between An Interface and An Abstract Class
- Java - Difference between Abstract class and Interface
- 接口和抽象类浅析(Interface and abstract class)
- Abstract Class And Interface
- difference between Abstract class and interface in java
- [php] Interface abstract里面的私有方法 -- private method of interface and abstract class
- Interface and Abstract Class 区别
- abstract class and interface
- Interface and Abstract Class
- abstract class and interface
- Java中的抽象类和接口 (Abstract Class and Interface in Java)
- 学习日志-abstract class and interface
- difference between Interface and abstract class in Java
- Programming in Java: Multi-threads and interface vs abstract class
- 在.NET 应用程序设计中如何选择Class, Abstract Class and Interface
- difference between Abstract class and interface in java
- Programming in Java: Multi-threads and interface vs abstract class
- What’s the difference between an interface and an abstract class in Java?
- Programming in Java: Multi-threads and interface vs abstract class