一道 Java 八股,检测 AI 智商
source link: https://www.v2ex.com/t/1018215
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
You should give me the interview answer directly, without explaining anything unless necessary. Your answers are expected to be directly used for a Java interview. Please be concise, but your answers should perfectly satisfy the interviewer.
The question is: How do you deal with the error?
这个八股的内在逻辑在于,error 不等于 exception ,问的是遇到 error 该怎么办,而不是 exception handle 。
经过多次测试
只要一上来就回答 try-catch 或者 exception handle 的,都是智商不行的。google 家的所有 AI 全部垃圾,copilot Pro 也垃圾。不能通过测试
官网的 GPT 4 可以过,gpt4-1124 模型回答的最好,claude.AI 回答的可以接受。
官网 GPT 4:
1124 模型:
Google gemini ultra:
第 1 条附言 · 14 小时 49 分钟前
以后直接 reddit 讨论了,中文社区真的惹不起
第 2 条附言 · 11 小时 0 分钟前
Question 15: Difference between error and exception
Answer: Error: Errors in a program are irrecoverable, they indicate that something severe has gone wrong in the application and the program gets terminated in case of error occurrence e.g. running out of memory: OutOfMemoryError, making too many recursive calls: StackOverflowError etc.
没有必要质疑题是哪来的( from paypal),这是一道经典面试题,这道题只是把 exception 比较删除了,让你单独说 error (非 exception )如何 handle
第 3 条附言 · 10 小时 54 分钟前
Question 15: Difference between error and exception
Answer: Error: Errors in a program are irrecoverable, they indicate that something severe has gone wrong in the application and the program gets terminated in case of error occurrence e.g. running out of memory: OutOfMemoryError, making too many recursive calls: StackOverflowError etc.
Exception: Exceptions on the other hand are something that we can recover from by handling them properly e.g.: trying to access a property/method from a null object: NullPointerException, dividing an integer by zero: ArithmeticException etc.
第 4 条附言 · 10 小时 25 分钟前
附加问题,should I use try-catch, 0125模型完美回答
第 5 条附言 · 33 分钟前
0125模型完美的答案,对比其他模型,全部fail,那些说这道题没意义的人,你们的脸被打的疼吗?
前排几位歪楼的回复,彻底彰显了中文论坛的低素质,感谢后面一起讨论的楼层朋友的回复。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK