Salesforce Certified Platform Developer I Exam With
Complete Solutions 100% Verified
Describe differences between Apex and traditional Programming Languages like Java. -
ANSWER 1.) Traditional Programming Languages are fully flexible, and allow you to tell
the system to do just about anything. Apex is governed, and can only do what the system
allows.
2.) Apex is case-insensitive
3.) Apex is on-demand, and is compiled and executed in the Cloud (i.e. on the server)
4.) Apex needs to be unit tested to deploy it into a Production environment
5.) Apex is not a general-purpose Programming Language. It can only be used on the
Force.com platform.
What are the two major components of Apex code? - ANSWER Apex Classes and Apex
Triggers
What is an Apex Class? - ANSWER An Apex Class is a template or a blueprint from
which Apex objects are created.
What is an Apex Trigger? - ANSWER A procedure that automatically executes during a
DML operation.
What are the three FOR() loops that Apex code supports? - ANSWER 1.) Traditional
FOR() loops
2.) List Iteration FOR() loops
3.) SOQL FOR() loops
What are the three types of Collection data types in Apex code? - ANSWER 1.) Lists
2.) Maps
,3.) Sets
What are Collections used for in Apex code? - ANSWER Collections are used to store
groups of elements, such as primitive data types, or sObjects.
Where are the three areas where you can develop Apex code? - ANSWER 1.) The
Force.com IDE
2.) The Developer Console
3.) The Setup menu
What conditional statements does Apex support? - ANSWER if-else
Which of the following conditional statements are not used in Apex? - ANSWER 1.)
case
2.) switch
What is the sObject data type? - ANSWER The sObject data type is a generic data type
and is the parent class for all standard and custom objects in Apex.
Which two of the following data types are native to Apex? - ANSWER 1.) sObject
2.) ID
What is a List? - ANSWER A List is an ordered collection of elements of a single data
type. Elements added to a List are assigned an implicit index, and therefore, Lists can
contain non-unique values (i.e. elements can be duplicated within a List).
What is a Set? - ANSWER A Set is an unordered collection of unique elements. There are
no indexes assigned to elements in a Set, and therefore, elements in a Set much be
unique.
, What is a Map? - ANSWER A Map is a set of key-value pairs. Keys must be unique, but
Values can be duplicated. With Maps, we provide the index, whereas in Lists, the index
is provided automatically when an element is added.
What is a typical use of Lists? - ANSWER Lists are often used to store the results of a
SOQL query.
What is one of the more common use cases for Sets? - ANSWER Sets are great to store
the values used in filtering data queried by SOQL.
What is a typical use case for Maps? - ANSWER Maps are a very common
implementation that serves as a cache of records accessible by key/ID.
Are Apex Arrays the same as Java Arrays? Why or why not? - ANSWER While the
notation for an Apex Array appears to be the same as a Java Array notation, they are
different internally. An Apex Array can be dynamically resized, while a Java Array
cannot be dynamically resized.
//Array notation
Account[] accounts = new Account[] {acc1,acc2,acc3};
//List notation
List<Account> accounts = new List<Accounts>;
accounts.add(acc1);
accounts.add(acc2);
accounts.add(acc3);
Are Lists also Arrays? - ANSWER No. Lists are not Arrays, but they can be
syntactically referenced as Arrays.
How would you be able to iterate over a Map? - ANSWER First retrieve the key set by
Complete Solutions 100% Verified
Describe differences between Apex and traditional Programming Languages like Java. -
ANSWER 1.) Traditional Programming Languages are fully flexible, and allow you to tell
the system to do just about anything. Apex is governed, and can only do what the system
allows.
2.) Apex is case-insensitive
3.) Apex is on-demand, and is compiled and executed in the Cloud (i.e. on the server)
4.) Apex needs to be unit tested to deploy it into a Production environment
5.) Apex is not a general-purpose Programming Language. It can only be used on the
Force.com platform.
What are the two major components of Apex code? - ANSWER Apex Classes and Apex
Triggers
What is an Apex Class? - ANSWER An Apex Class is a template or a blueprint from
which Apex objects are created.
What is an Apex Trigger? - ANSWER A procedure that automatically executes during a
DML operation.
What are the three FOR() loops that Apex code supports? - ANSWER 1.) Traditional
FOR() loops
2.) List Iteration FOR() loops
3.) SOQL FOR() loops
What are the three types of Collection data types in Apex code? - ANSWER 1.) Lists
2.) Maps
,3.) Sets
What are Collections used for in Apex code? - ANSWER Collections are used to store
groups of elements, such as primitive data types, or sObjects.
Where are the three areas where you can develop Apex code? - ANSWER 1.) The
Force.com IDE
2.) The Developer Console
3.) The Setup menu
What conditional statements does Apex support? - ANSWER if-else
Which of the following conditional statements are not used in Apex? - ANSWER 1.)
case
2.) switch
What is the sObject data type? - ANSWER The sObject data type is a generic data type
and is the parent class for all standard and custom objects in Apex.
Which two of the following data types are native to Apex? - ANSWER 1.) sObject
2.) ID
What is a List? - ANSWER A List is an ordered collection of elements of a single data
type. Elements added to a List are assigned an implicit index, and therefore, Lists can
contain non-unique values (i.e. elements can be duplicated within a List).
What is a Set? - ANSWER A Set is an unordered collection of unique elements. There are
no indexes assigned to elements in a Set, and therefore, elements in a Set much be
unique.
, What is a Map? - ANSWER A Map is a set of key-value pairs. Keys must be unique, but
Values can be duplicated. With Maps, we provide the index, whereas in Lists, the index
is provided automatically when an element is added.
What is a typical use of Lists? - ANSWER Lists are often used to store the results of a
SOQL query.
What is one of the more common use cases for Sets? - ANSWER Sets are great to store
the values used in filtering data queried by SOQL.
What is a typical use case for Maps? - ANSWER Maps are a very common
implementation that serves as a cache of records accessible by key/ID.
Are Apex Arrays the same as Java Arrays? Why or why not? - ANSWER While the
notation for an Apex Array appears to be the same as a Java Array notation, they are
different internally. An Apex Array can be dynamically resized, while a Java Array
cannot be dynamically resized.
//Array notation
Account[] accounts = new Account[] {acc1,acc2,acc3};
//List notation
List<Account> accounts = new List<Accounts>;
accounts.add(acc1);
accounts.add(acc2);
accounts.add(acc3);
Are Lists also Arrays? - ANSWER No. Lists are not Arrays, but they can be
syntactically referenced as Arrays.
How would you be able to iterate over a Map? - ANSWER First retrieve the key set by