逃了好几节课,上了3节课好在还能听懂.
1.auto wrapping :自动封装。其实没什么,就是想把基本类型用类来表示
2.Object类。
3. Exception。分成两类,RuntimeException & Others(non RuntimeException).后一种是应该capture..RuntimeException非检查性异常,大部分是由程序员自己失误造成的。如果在程序throw Exception 时没有capture, 则Exception会往上抛(Others必须手动throws,而RuntimeException 是自动),若没有capture exception.则程序终止。语句代码块:try{}catch{}fianlly{}
finally{} will execute no matter if catch{} executed or not. it usually is used to do clean up work.
4.Inner Class. Which could be divided into four category. member inner class, top inner class(static), local inner class(which is inside outer class's method) and anonymouse class(which is used in the object is created, like adaptor). Inner class is like the fields of a class. so static inner class cannot access outer class's non-static fields(neither it's own static class).
How to instantise a member inner class?
1. create an outer class object : Outer ot = new Outer();
2. create inner class with outer calss: Outer.Inner oi = ot.new Outer.Inner();
How to create a static(top) inner class
Outer.Inner oi = new Outer.Inner();