throw
is a variant of goto
. goto
, the programmer of the throw
statement does not specify a label where the execution of the program is transferred to. It will be one of the (hopefully?) available catch
blocks up the calling hierarchy. throw
also differs from goto
in that the programmer passes an instance of a class that derives from System.Exception
to the receiver. This allows to throw
to the receiver in catch(ExCls data)
.
catch()
blocks that are able to receive the thrown class