While a getter method is always required to access values from a controller, it’s not always necessary to include a setter method to pass values into a controller. Visualforce doesn’t define the order in which setter methods are called: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_methods.htm
According to the dev guide, B doesn't seem correct. It says, "While a getter method is always required to access values from a controller, it’s not always necessary to include a setter method to pass values into a controller."
So, setter is not required always.
While a getter method is always required to access values from a controller, it’s not always necessary to include a setter method to pass values into a controller.
You could say that alternative B is poorly written... Because it would be possible to interpret that 'a setter needs to pass a value's.... Just like 'passengers need to stay in their seats' or 'passengers are required to stay in their seats'
But I could not find any evidence that C is correct
[quoting]
"Getting and Setting Data with a Custom Extension or Controller
There is no guaranteed order in which Apex methods and variables are processed by a controller extension or custom controller. Therefore, do not allow controller and extension classes to rely on another method being run, call that method directly. This applies specifically to setting variables and accessing data from the database."
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_methods.htm
upvoted 1 times
...
...
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
MuzaffarMoiz
Highly Voted 3Â years, 1Â month ago[Removed]
Highly Voted 3Â years, 1Â month agoSanjeevOnForce
Most Recent 1Â year agoirina_735
1Â year, 2Â months agoBrucePark
1Â year, 4Â months agoJhonvf20
1Â year, 5Â months agoDean5555
2Â years, 1Â month agoDean5555
2Â years, 1Â month agoRMEZZA
1Â year, 9Â months agomariamarlenepereira9
10Â months ago