C++, Java, and Ruby exception handling compared : rescue « Statement « Ruby






C++, Java, and Ruby exception handling compared

C++             Java                  Ruby
try {}          try {}                begin/end
catch {}        catch {}              rescue keyword (or catch method)
Not applicable  finally               ensure
throw           throw                 raise (or throw method)

 








Related examples in the same category

1.rescue's syntax makes handling different exceptions in different ways easy:
2.how exceptions work in Ruby.
3.Handling Exceptions: 10 / 0
4.Handling Passed Exceptions
5.begin