Pelayar ini tidak lagi disokong.
Naik taraf kepada Microsoft Edge untuk memanfaatkan ciri, kemas kini keselamatan dan sokongan teknikal yang terkini.
A developer needs to create and throw an exception in a C# application. Which of the following descriptions is correct?
The exception type shouldn't match the intended purpose of the exception.
The exception type that they create depends on the coding issue.
The process for throwing an exception object involves using the catch keyword.
catch
When should a method throw an exception?
A method should throw an exception when the method can complete its intended purpose.
A method should throw an exception when the method can't complete its intended purpose.
A method should throw an exception when an exception type matches the intended purpose of the method.
A developer needs to create an exception object that includes a specific Message property. Which of the following statements is correct?
Message
The Message property of an exception is writable.
The Message property shouldn't explain the reason for the exception.
The Message property should explain the reason for the exception.
You must answer all questions before checking your work.
Adakah halaman ini membantu?
Perlukan bantuan dengan topik ini?
Ingin cuba menggunakan Ask Learn untuk menjelaskan atau membimbing anda melalui topik ini?