"September brings a hint of autumn’s promise! Happy September @TRY3STEPS.COM
Dear Reader, If you use TRY3STEPS a lot, this message is for you. This incredible nonprofit organization helps the world with answers. We love you, we share answers. Your love helps us thrive. The more we give, the more we have! Thank you for inspiring us. (Secure PayPal)

*Everything counts! No minimum transaction limit!
Stay Updated with the World! Subscribe Now:: YouTube.com/c/Try3Steps
Say Hello to Try3Steps Group! Join Now:: GoogleGroup@Try3Steps

Search Another Question

Jun 7, 2017

[Ans] which keyword is used to monitor statement for exception?


Step 1 : Introduction to the question "which keyword is used to monitor statement for exception?"



Alternative approaches to exception handling in software are error checking, which maintains normal program flow with later explicit checks for contingencies reported using special return values or some auxiliary global variable such as C's errno or floating point status flags; or input validation to premptively filter exceptional cases.



Step 2 : Answer to the question "which keyword is used to monitor statement for exception?"



try keyword is used to monitor statement for exception. The scope for exception handlers starts with a marker clause (try or the language's block starter such as begin) and ends in the start of the first handler clause (catch, except, rescue). try { line = console.readLine(); if (line.length() == 0) { throw new EmptyLineException("The line read from console was empty!"); } console.printLine("Hello %s!" % line); console.printLine("The program ran successfully"); } catch (EmptyLineException e) { console.printLine("Hello!"); } catch (Exception e) { console.printLine("Error: " + e.message()); } finally { console.printLine("The program terminates now"); }


Step 3 : Other interesting facts related to the question "which keyword is used to monitor statement for exception?"



From the point of view of the author of a routine, raising an exception is a useful way to signal that a routine could not execute normally - for example, when an input argument is invalid Languages where exceptions are only used to handle abnormal, unpredictable, erroneous situations: C++, C#, Common Lisp, Eiffel, and Modula-2. Languages where exceptions are designed to be used as flow control structures: Ada, Java, Modula-3, ML, OCaml, Python, and Ruby fall in this category. Next Step : We care our friends, so we share answers. If you care Share/comment this post.

No comments:

Post a Comment