Prev
7. UML
Next
9. Collections

8. exercise: Exceptions and Assertions

  1. Review presentation Exceptions and assertions

      

  2. Investigate jtm.activity08 package
  3. Create class SimpleCalcException as a subclass of Exception
  4. Implement following constructors for this class:
    1. SimpleCalcException(String string)
    2. SimpleCalcException(String string, Throwable cause)
  5. Implement basic mathematical operations for SimpleCalc class with int numbers in range of [-10..+10] (including) to pass unit tests

error Notes

  1. Input range is checked using assertions (so if they are disabled, inputs can be any int)
  2. Outputs are always checked and exception is thrown if it is outside allowed range

Prev
7. UML
Next
9. Collections
Tags:
Created by Valdis Vītoliņš on 2017-01-03 10:07
Last modified by Valdis Vītoliņš on 2018-04-16 10:51
 
Xwiki Powered
Creative Commons Attribution 3.0 Unported License