高级农民
- 积分
- 1406
- 大米
- 颗
- 鳄梨
- 个
- 水井
- 尺
- 蓝莓
- 颗
- 萝卜
- 根
- 小米
- 粒
- 学分
- 个
- 注册时间
- 2017-5-6
- 最后登录
- 1970-1-1
|
3.21
一:chest day: bench press(80 3sets*5reps 60 1set*10rep) incline bench press(50 4set*9reps) butterfly (70 4sets*8reps) cable crossover (60 4sets*10reps)
二:learnt git : \git add filename \git commit -m "description" \git status \git diff \git log \git reflog \git reset --hard commit_id \git checkout -- filename \git reset HEAD filename \git rm filename
三:cs61b hw4: inheritance!
1. you can add new fields in your subclass, but not modify fields in superclass
2.in the constructor of your subclass, it will invoke super.constructor() automatically, only if you invoke another super's constructor with params.
3.inheritance means you want to use some properties of superclass, and specify some of them or add new ones. you should only focus on the specifying and adding parts. if you don't change the params and return type(can be subclass of the origin return type), you are overriding. if you change the params(order, type or numbers of params ), no matter whether you changed the return type, you are overloading!
四:cs61b Exceptions
1.when a run-time error occurs, JVM will throw a exception, you should solve it, or your program will halt. using try and catch to solve such exceptions. try can be followed by several catches, and the order is matter, cuz the program will match first proper catch. so put the most specific one on the top and the most general one on the bottom.
2. class extends Exception method throws XxxException in method body throw new XxxException()
3.if there are anything should be executed no matter exception occurs or not, you should put finally{} after catch. and finally will run even if there is return in try or catch.
4.when facing exceptions, you must follow try/catch or duck principle, which means other than use try/catch to solve them, you can just add the "throws XxxException" to modify your method when you calling the risky method. in this way, the method, which called the risky method , become a risky method. anyone who call this method must make a choice between try/catch and duck.
5.the top-level of class exception is Throwable, and Exception and Error are subclass of it. error and RunTimeException are unchecked, which means method dealing with them can throw exceptions without in a class with throws XxxException modifier. other exceptions are checked, which means you must make the throws modifier.
ps:
今天和黑妹聊了俩小时,给我讲述了她疯狂关心她的牙买加妈妈制定的交往对象标准,以及她在牙买加度过的因为聪明而受校园霸凌的小学生涯,面对一个另一国度的同龄女人突然对你袒露心扉,还真有点不适应。。时不时的再来个害羞的小表情。。我仿佛看到了黑妹狂野卷发下水汪汪的大眼睛以及粉嫩的少女心。。 |
|