Question: 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

1 Expert Approved Answer
Step: 1 Unlock

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 ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!