今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Challenge: Handle an ArithmeticException
(electronic music) - [Instructor] We have seen a variety of exceptions so far. And for this challenge, you will have to handle a runtime exception, more specifically the arithmetic exception. This is caused by an invalid arithmetic or mathematical operation, like dividing by zero. For this challenge, I have added yet another end point to find the ratio for a given index and its predecessor. For instance, if the index requested is three, we would retrieve the third number in the Fibonacci sequence, which is two. We would also retrieve the second index in the sequence, which is one, two divided by one is the ratio between the index requested and its predecessor. And the result which is two, is what the end point will return. Why do we care about generating the ratio beyond needing some way to do this challenge and trigger an arithmetic exception? Well the ratio between two consecutive numbers in the Fibonacci…
内容
-
-
-
-
-
(已锁定)
What are runtime exceptions?2 分钟 28 秒
-
(已锁定)
Runtime exception: Return NumberFormatException to user9 分钟 25 秒
-
(已锁定)
Challenge: Handle an ArithmeticException3 分钟 59 秒
-
(已锁定)
Solution: Handle an ArithmeticException3 分钟 18 秒
-
(已锁定)
Runtime exception: Handling of NullPointerException6 分钟 16 秒
-
(已锁定)
Runtime exception: Unknown runtime exception4 分钟 18 秒
-
(已锁定)
Challenge: Handle potential runtime exceptions1 分钟 19 秒
-
(已锁定)
Solution: Handle potential runtime exceptions4 分钟 1 秒
-
(已锁定)
-