Skip to content

Understand Exception Handling practically

Mahmood Rasheed requested to merge exception-handling-practice into main

Got exposure of exception handling. Learned different ways to handle exception:

  1. try-catch
  2. try-multiple catch
  3. nested try-catch
  4. throw keyword
  5. throws keyword

=> Build a custom exception "NegativeNumberException" which will resist the user to enter a negative number. => Used this user-defined exception for factorial calculator which will calculate the factorial of given number, if given number is positive

Merge request reports