The abstraction in detailed and analytic Java kind the distinction with interfac
From; Author:Stand originally
Brief summary
1.abstract Class is denotive in Java language it is a kind of successive relation, kind can use successive relationship only. But, kind can realize many Interface however.
2. There can be oneself data member in Abstract Class, also can have the member method that is not Abstarct, and in Interface, the data member that cannot be revised what can have a static state only (must be Static Final namely, general in Interface nevertheless adventitious justice data member) , all member methods are Abstract.
3.abstract Class and the design concept that Interface place mirrors instead are different. Abstract Class is actually denotive it is "is-a" relation, interface is denotive it is "like-a" relation.
4. Implementation is abstract kind with interface kind must implement among them all method. Abstract kind in can have blame abstraction method. There cannot be implementation method in interface.
5. The variable acquiesce of the definition in interface is Public Static Final model, and must give its initial value, come true so kind in cannot redefine, unalterable also its are worth.
6. Abstract kind of medium variable is acquiescent it is Friendly model, its value can be in subclass redefine, also can assign afresh.
7. The methodological acquiesce in interface is Public, of Abstract type.
Conclusion
Two kinds of definitions that Abstract Class and Interface are Java language call the turn are abstract kind means, there is very big similar sex between them. But often mirror instead again however to their choice reasonable, because they behaved the disparate impact between the concept (although can the function of implementation requirement) . This also is usage of a kind of the language be used to actually, hope reader friend can fine fine experience.
Previous 1 2 3 4 5Next