Study for the Salesforce Platform Developer Exam. Study with flashcards and multiple choice questions, each question has hints and explanations. Get ready for your exam!

Practice this question and more.


What does the user see when accessing the custom page in the given controller?

  1. getMyString,

  2. , , Method2,

  3. Method2, getMyString

  4. getMyString, Method2, getMyString

The correct answer is: getMyString, Method2, getMyString

The user sees the output of the controller methods when accessing the custom page. In this context, the correct choice indicates that the output includes the result of the 'getMyString' method followed by 'Method2', and then repeats the output of 'getMyString' again. This suggests that the methods are designed to be called or displayed in this specific order. The method 'getMyString' likely retrieves or generates a string value, and it's expected to be displayed multiple times as per the design or functionality of the custom page. The presence of 'Method2' in between means that it performs its function, possibly returning another value or modifying the state in a way that is relevant to the displayed information. Having 'getMyString' appear twice could imply it is called again for a specific purpose, perhaps to show the latest state of the data or simply to repeat the initial output for clarity or emphasis. Thus, the overall output reflects both the retrieval of the string and the execution of an additional method, creating a cohesive display of information for the user.