nerdexam
SalesforceSalesforce

PDI · Question #62

PDI Question #62: Real Exam Question with Answer & Explanation

Sign in or unlock PDI to reveal the answer and full explanation for question #62. The question stem and answer options stay visible for context.

Submitted by diego_uy· Apr 18, 2026Logic and Process Automation

Question

A developer has an integer variable called maxAttempts. The developer meeds to ensure that once maxAttempts is initialized, it preserves its value for the lenght of the Apex transaction; while being able to share the variable's state between trigger executions. How should the developer declare maxAttempts to meet these requirements?

Options

  • ADeclare maxattempts as a member variable on the trigger definition.
  • BDeclare maxattempts as a private static variable on a helper class
  • CDeclare maxattempts as a constant using the static and final keywords
  • DDeclare maxattempts as a variable on a helper class

Unlock PDI to see the answer

You've previewed enough free PDI questions. Unlock PDI for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Topics

#Apex Variable Scope#Apex Static Keyword#Apex Final Keyword#Apex Transactions
Full PDI PracticeBrowse All PDI Questions