楼主: jaly50
跳转到指定楼层
上一主题 下一主题
收起左侧

Berkeley CS 61B Data Structures(in Java) Lab6 讨论帖

 
🔗
arieslpx 2017-6-1 20:41:45 | 只看该作者
全局:
之前听课的时候还不是很懂throws和try catch的区别 做了这次lab作业终于明白了

lab6.png (10.57 KB, 下载次数: 0)

lab6.png
回复

使用道具 举报

🔗
liniua 2017-6-8 13:29:35 | 只看该作者
全局:

-------------------
Welcome to the bank
-------------------

Valid commands are: open, deposit, withdraw, inquire, quit
--> open
Enter name: nana
nana, your new account number is: 100
Thanks for opening an account with us!
--> deposit
Enter account number: 100
Enter amount to deposit: 100
New balance for #100 is 100
--> deposit
Enter account number: 102
Enter amount to deposit: 100
Enter account number: BadAccountException: Invalid account number: 102
100
Enter amount to deposit: 50
New balance for #100 is 150
--> withdraw
Enter account number: 100
Enter amount to withdraw: 40
New balance for #100 is 110
--> withdraw
Enter account number: 103
Enter amount to withdraw: 10
BadAccountException: Invalid account number: 103
Enter account number: 100
Enter amount to withdraw: -30
Enter account number: BadTransactionException: Negative amount: -30
100
Enter amount to withdraw: 60
New balance for #100 is 50
--> inquire
Enter account number: 100
Balance for #100 is 50
--> quit

Process finished with exit code 0
回复

使用道具 举报

🔗
yywwd 2017-7-16 10:38:13 | 只看该作者
全局:
弄是弄出来了,但是这个bug是怎么回事:直接run,会先出现enter account number的字样,再出现exception,而且只出现一次。之后还会出现exception,然后没有换行直接出现enter account number的字样,也是只出现一次。但是!!我用debug F6一步一步调试,就全都正常
更多图片 小图 大图
组图打开中,请稍候......
回复

使用道具 举报

🔗
yagamy 2017-8-1 03:02:05 | 只看该作者
全局:
throw来throw去 挺好玩的哈哈~ 要搞清楚这么多个file之间的相互调用关系,还是很难,看了半天基本明白了,但是想象一下如果是要我自己写,那就绝对不行了……

lab.PNG (34.35 KB, 下载次数: 0)

lab.PNG
回复

使用道具 举报

🔗
ychen628 2017-10-3 13:04:10 | 只看该作者
全局:
打个卡,exception 还蛮有意思的
file:///Users/zoe/Desktop/screenshots/Screen%20Shot%202017-10-03%20at%203.33.36%20PM.png
回复

使用道具 举报

🔗
shi198 2017-12-27 11:21:35 | 只看该作者
全局:
有谁知道为什么我第一个exception catch之后command是重复了 但是是在error message之前 但是后面再catch就没有问题了



回复

使用道具 举报

🔗
dachou 2017-12-27 18:09:18 | 只看该作者
全局:
四五天前做的了,忘记了当时的思路了~唉,以后还是要写下来

Snip20171223_19.png (87.36 KB, 下载次数: 0)

Snip20171223_19.png
回复

使用道具 举报

🔗
wangguoxia 2017-12-29 21:00:11 | 只看该作者
本楼:
全局:
fighting

Lab6.png (37.8 KB, 下载次数: 0)

Lab6.png
回复

使用道具 举报

🔗
仙道彰 2017-12-29 21:18:22 | 只看该作者
全局:
交作业啦交作业啦,交完了健身!!!

Lab6.png (38.15 KB, 下载次数: 0)

Lab6.png
回复

使用道具 举报

🔗
greatlim 2018-2-19 00:55:38 | 只看该作者
全局:

学习了exception的构造,和try catch的使用,感觉还不错
肉眼看bug的能力还不够哇
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表