9, error handling
1, what is a exception:
when something wrong happend , and this situation is never been considered.
2, how to fix a exception
there are two models to handle errors.one is termination , another iesumption.
resumption will caused coupling.
3, "checked exception", unchecked exceptions
4,
if(t == null) throw new NullPointerException();
can u find the problem with the formed codes
5, runtimeexception
So the answer is: If a RuntimeException gets all the way out to main( ) without being caught, printStackTrace( ) is called for that exception as the program exits. Feedback
6,finally块中不允许使用return,continue或break的原因
7, if a sub class want to throw a exception, it must be the one that have been thrown by its parent class.
8, class intialization
a:super class's static variable. b:all the classes's(including base class and sub class) non-static member variable will be intialized
as bit zero. c:base class's non-static variable will be inited. d: base class's constructor will be called.e:self constructor will be
initilized.
9, oop's three characteritcs:1, data abstraction, 2, Inheritance. 3, polymorphism.