Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help defining the following exeptions using the same template as described below for each question Template: - What is a possible situation that

I need help defining the following exeptions using the same template as described below for each question

Template:

- What is a possible situation that leads to the exception?

- Who is in charge of throwing the exception: you as a programmer or the runtime system? In theory, should you throw exceptions of this type? Explain your answer.

- If you need to throw the exception, what details would you provide as a message to the user (caller)? What parameters would you include in the message?

- Can the exception be generally caught (and therefore handled)?

- If the exception occurs, should you generally catch this exception type or is it better to pass such exception to the user (caller)? It is not enough to say yes or no; you must provide an argument to support your answer.

- Is the exception a case when you want to avoid this exception to occur in your application in general? If so, what would be your actions as a programmer to avoid it?

The exeption questions:

  1. NullReferenceException
  2. IndexOutOfRangeException
  3. StackOverflowException
  4. OutOfMemoryException
  5. DivideByZeroException
  6. ArgumentNullException
  7. ArgumentOutOfRangeException
  8. FormatException
  9. ArgumentException
  10. SystemException

Step by Step Solution

There are 3 Steps involved in it

Step: 1

NullReferenceException Possible situation Trying to access a member method or property of a null object Who throws the exception The runtime system throws the exception ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microeconomics

Authors: Paul Krugman, Robin Wells

3rd edition

978-1429283427, 1429283424, 978-1464104213, 1464104212, 978-1429283434

More Books

Students also viewed these Programming questions

Question

=+4 How would you establish a control group?

Answered: 1 week ago

Question

14. What are the functions of the prefrontal cortexpg109

Answered: 1 week ago

Question

22. How do opiates influence dopamine synapsespg109

Answered: 1 week ago