Contact: aviboots(AT)netvision.net.il
40,954 questions
53,418 answers
573 users
main() { try { throw "throw exception"; } catch (e) { print("Exception: $e"); } } /* run: Exception: throw exception */
void main() { try { test(-7); } catch(e) { print('Number cannot be negative'); } } void test(int n) { if(n < 0) { throw new FormatException(); } } /* run: Number cannot be negative */