thinking in java 3 notes

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.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值