1. सीखें
  2. /
  3. पाठ्यक्रम
  4. /
  5. Data Types and Exceptions in Java

Connected

अभ्यास

Try-catch

Catch a possible arithmetic exception - division by zero - and handle it by displaying a message. You will also get a chance to see more use of the BigDecimal package that has been preloaded for you.

निर्देश

100 XP
  • Add a try and the start of the try code block.
  • Catch the ArithmeticException with (ArithmeticException e) and start a catch code block.
  • Finish the catch code block.