coreJava 学习日记

逃了好几节课,上了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();

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值