Multiple choice technology programming languages

You are working on a debug build of an application. You need to find the line of code that caused an exception to be thrown. Which property of the Exception class should you use to achieve this goal?

  1. Data

  2. Message

  3. StackTrace

  4. Source

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The StackTrace property provides a detailed call stack that shows the sequence of method calls that led to the exception, including the exact line numbers where the exception originated. This is precisely what a developer needs to locate the problematic code. The Message property only contains a description of the error, while Data contains arbitrary additional information, and Source indicates the application name - none provide the specific line location like StackTrace does.