1. two methods of reusing classes
2. initializing the base class 【程序编程相关:关于javabean的一些文档 】
1.1 composition1.2 inheritance 【推荐阅读:编程范式[paradigm] 】
3. cleanup 【扩展信息:关于词法分析器的小程序 】
in the constructor, call "super(agument list)" first, or the compiler will call default constructor of the base class.
3.1 commonly, there is no need to do this.3.2 if you really want to do something cleanup, use "try { } finally { }".3.3 first, "this.cleanup()", then "super.cleanup()".
4. composition vs. inheritance
composition: has-a relationinheritance: is-a relation
5. upcasting
if a function is definded as "func(objecta aaa)",you can use "func(bbb)" when "bbb" is objectb which extends objecta.at this time, "bbb" is upcasted to a objecta.
6. "final"
6.1 final data
... 下一页