試験CRT-450-JPN トピック2 問題164 スレッド

Salesforce CRT-450-JPNのリアル試験問題集
問題 #: 164
トピック #: 2
開発者には、maxAttempts という整数変数があります。開発者は、maxAttempts が初期化されると、その値が Apex トランザクションの長さにわたって保持されるようにする必要があります。トリガーの実行間で変数の状態を共有できます。これらの要件を満たすには、開発者は maxAttempts をどのように宣言する必要がありますか?

おすすめの解答:B 解答を投票する

The best way to declare maxAttempts to meet the requirements is to declare it as a private static variable on a helper class. This will ensure that the variable is initialized only once per Apex transaction, and that its value is preserved and shared across trigger executions. A private static variable is a variable that belongs to a class and not an instance, and that can only be accessed within the class. A helper class is a class that contains common methods or variables that can be used by other classes or triggers.
References: The use of private static variables and helper classes can be referenced in the Salesforce Platform Developer I learning documents, specifically in modules that cover Apex basics and triggers, such as:
* Apex Basics & Database
* Apex Triggers
* Apex Testing

答え修正ちゃん 2024-01-29 01:52:09

コメント

正解:
?」こちらは投票コメントになっております。普通のコメントに切り替えます。
ニックネーム: 送信 キャンセル
答え修正ちゃん
2024-01-29 13:52:09
maxattemptは定数として宣言する
1 回賛成
...
投票コメントをあげるごとに、選択した解答の投票数を1つ増やすことができます。

他人の解答コメントを賛成するのも、その解答に一票を入れることになります。したがって、すでに同じ意見の投票コメントが存在する場合、新規コメントをする代わりに賛成することもできます。

弊社を連絡する

我々は12時間以内ですべてのお問い合わせを答えます。

オンラインサポート時間:( UTC+9 ) 9:00-24:00
月曜日から土曜日まで

サポート:現在連絡