Contact: aviboots(AT)netvision.net.il
40,758 questions
53,129 answers
573 users
void main() { int x = 19; int y = 0; int result; try { result = x ~/ y; } on IntegerDivisionByZeroException { print('Error: divide by zero'); } } /* run: Error: divide by zero */
void main() { int x = 19; int y = 0; int result; try { result = x ~/ y; } catch(e) { print(e); } } /* run: IntegerDivisionByZeroException */
void main() { int x = 19; int y = 0; int result; try { result = x ~/ y; } on IntegerDivisionByZeroException catch(e) { print(e); } } /* run: IntegerDivisionByZeroException */
void main() { int x = 19; int y = 0; int result; try { result = x ~/ y; } on IntegerDivisionByZeroException { print('Error: divide by zero'); } finally { print('Finally'); } } /* run: Error: divide by zero Finally */