CodeGym /课程 /Java 语法 /练习显示堆栈跟踪 练习显示堆栈跟踪 Java 语法 第 9 级 , 课程 2 可用 “嗨,阿米戈!” “嗨,迭戈!” “这是显示堆栈跟踪的一项小任务。” 评论 (17) TO VIEW ALL COMMENTS OR TO MAKE A COMMENT, GO TO FULL VERSION Noob_Coder 级别 22,Springfield,United States Expert 18 六月 2024 Solution.class.getName() should give the exactly same class output, but won't pass the task, so you have to use getClassName(), which is ridiculous. tom 级别 19,Ottawa,中国 18 三月 2024 1、获得知道调用方的位置,位于下面2,先来后到,先到先得,堆栈就是这么的不要face 2、知道stackTrace相关的一些常用的方法,及常用的一些类库信息。 Super Ego 级别 14,Wu Han,China 28 二月 2023 类名:StackTraceElement 的 getClassName(); 拔萝卜滴🐰 级别 22,chengdu,China Expert 6 二月 2023 最后一题冒号后有一个空格 简默 级别 15,Central District,Hong Kong 5 十二月 2023 你咋这么厉害呢😃 peifeng 级别 17,Hangzhou,China 9 十二月 2024 而且是每个:后面都有个空格,但是题干里的示例第二个冒号后面没有空格,太坑了 ForestHo 级别 15,Washington,China 4 一月 2025 你咋这么牛呢 404 级别 20,Guangzhou,China 3 十二月 2022 为什么倒数第二题是12? Anonymous #10765066 级别 15,China 13 七月 2021 Here is a little tip about the last question ,you must use ":"in english keyboard and plus a blank between classname and methodname. i hope that tip could give you some useful suggestion rookie 级别 22,Minsk 28 二月 2021 stackTraceElement[0].getMethodName(); name: getStackTrace stackTraceElement[1].getMethodName(); name: 他自己的名称 stackTraceElement[2].getMethodName() name: 调用它的方法的名称 以此类推 SSSSnorlax 级别 13,Hangzhou,China 29 三月 2021 i see,excellent! Yingjie Guan 级别 18,Quarry Bay 9 七月 2021 Thank you ,I understand ! hello world 级别 22,shanghai,China 20 十月 2021 good sky 级别 22 15 八月 2022 good momoshenchi 级别 22,Wenzhou,China 29 六月 2020 why the depth is 12 in the second last Pepper 级别 23,San Francisco 17 十月 2020 u said the third last? Its full stack is : getStackTrace method10 method9 ... method2 method1 main So the depth is 12 BangC 级别 9,China 10 三月 2021 good
GO TO FULL VERSION