nerdexam
SalesforceSalesforce

PDI · Question #24

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

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

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

Question

A developer is implementing an Apex class for a financial system. Within the class, the variables `creditAmount' and `debtAmount' should not be able to change once a value is assigned. In which two ways can the developer declare the variables to ensure their value can only be assigned one time? Choose 2 answers

Options

  • AUse the static keyword and assign its value in the class constructor.
  • BUse the final keyword and assign its value in the class constructor.
  • CUse the static keyword and assign its value in a static initializer.
  • DUse the final keyword and assign its value when declaring the variable.

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 Variables#Final Keyword#Immutability
Full PDI PracticeBrowse All PDI Questions