Class: [visibility] Name attribute: Type [= default]
Note: "Visibility" represents an element outside the class attribute is visible,
Both public (Public), private (Private), protected (Protected) and friends (Friendly) 4 species, respectively, in FIG class by symbol +, -, #, ~ Fig.
interface:
Class relationships from strong to weak: Generalization (inheritance) implemented => composition> polymerization> related> dependent
1 , generalization (inheritance): such as the relationship between animals and tigers
2 , to achieve: Implement Interface
3 , in combination: a strong relationship, and the entire part can not leave alone
4, the polymerization: Relationship has-a, the portions may be integrally leave alone .
Aggregation relationship is a relationship is strong association relationship; correlation and aggregation syntactically indistinguishable, must examine specific logic.
5 , the association: as member variables, is a relationship of have, it makes a class knows another class attributes and methods; such as: teachers and students, husband and wife can be a two-way association can be unidirectional
6 , dependency: such as local variables, parameters, or method calls to static methods