What is an accurate constructor for a custom controller named - ProProfs Discuss
Topics
Products
Follow Us:

What is an accurate constructor for a custom controller named "MyController"?



A. A. public MyController () {account = new Account () ;}
B. B. public MyController (sObject obj) {account = (Account) obj;}
C. C. public MyController (List objects) {accounts = (List ) objects;}
D. D. public MyController (ApexPages.StandardController stdController) {account = (Account) stdController.getRecord();}

This question is part of Salesforce Platform Developer 1
Asked by Wyatt Williams, Last updated: Jan 15, 2020

+ Answer
Request
1

2 Answers

D. Ronald

D. Ronald, Writer, Austin

Answered Sep 25, 2018

Different constructors enable developers to name the controllers. Different custom controllers have different constructors, depending on the name assigned to them. Basic constructors allow the development of basic systems. If you need a custom controller, by the name of ‘MyController’ you need to create a constructor following a specific command.

A typical constructor of the sort may look like, public MyController () {account= new Account () ;}. This will allow you to create a custom controller with the name “MyController”. It is important to place the commands in the correct order so that the system identifies it and enables the correct function.

 

Wyatt Williams

Wyatt Williams

Answered Mar 22, 2018

A. public MyController () { account = new Account () ; }

####
 

Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer

Email Sent
We have sent an email to your address "" with instructions to reset your password.