Jump to content

Exceptions: Difference between revisions

→‎{{header|J}}: Added throwing of an error.
(Added code example, J)
(→‎{{header|J}}: Added throwing of an error.)
Line 140:
=={{header|J}}==
u :: v
Program<tt> u :: v </tt>executes <tt>u</tt> and provides its result as output unless an error occurs. In case of error, the result of <tt>v</tt> is provided instead.<br>
An error condition can be forced in explicit definition by use of<tt> assert. </tt> as seen below.
uWillFail =: 3 : 0
assert. 0
)
 
=={{header|Java}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.