100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
PD1 Study Cards exam with correct answers 2024 $12.99   Add to cart

Exam (elaborations)

PD1 Study Cards exam with correct answers 2024

 0 view  0 purchase
  • Course
  • PD1 Study Cards
  • Institution
  • PD1 Study Cards

What are the primitive data types available in Apex? correct answers (12) Blob - Store a collection of binary data Boolean - true / false Date DateTime Decimal - currency values Double - 64-bit number with a decimal value ID - 18 character ID Integer - 32-bit number with a decimal value L...

[Show more]

Preview 4 out of 45  pages

  • October 15, 2024
  • 45
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • PD1 Study Cards
  • PD1 Study Cards
avatar-seller
HopeJewels
PD1 Study Cards

What are the primitive data types available in Apex? correct answers (12)
Blob - Store a collection of binary data
Boolean - true / false
Date
DateTime
Decimal - currency values
Double - 64-bit number with a decimal value
ID - 18 character ID
Integer - 32-bit number with a decimal value
Long - 64-bit number with a decimal value
Object - represent any data type in Apex
String
Time

What are the complex data types available in Apex? correct answers (6)
List - an ordered collection of elements
Set - unique collection of elements
Map - store key-value pairs of elements
Enum - define a set of possible values
sObject - Store a record of an object
Class Object - Used to access class methods and variables

Describe Blob and when to use it correct answers A collection of binary data that can
be used as web service argument, body of a document, or attachment.

When an attachment in Salesforce needs to be stored as a variable. It can be used to
convert the attachment into a single object.

Describe Boolean and when to use it correct answers A value that can only be
assigned true, false, or null.

Boolean data type can be used as a flag in Apex to check for a particular condition.

Describe Date and when to use it correct answers A data type used to store a value
that represents a particular date. System static methods are used to create date values.

When a specific date needs to be stored. For example, the date of a company's
establishment.

,Describe DateTime and when to use it correct answers A data type used to store a
value that represents a particular date and time. System static methods are used to
create date and time values.

The date and time is required, for example a timestamp value.

Describe Decimal and when to use it correct answers An arbitrary precision number
and automatically assigned to Currency fields.

When handling numbers that include decimal points such as currency values, or when
the number of decimal places need to be explicitly set.

Describe Double and when to use it correct answers A 64-bit number that includes a
decimal point

Double can be used when large 64-bit numbers with decimal point are required.

Describe ID and when to use it correct answers A data type used to store any valid 18-
character Force.com identifier, such as '0014100000JGhi8AAD'

When a record of an object needs to be identified and updated in Salesforce
programmatically.

Describe Integer and when to use it correct answers A signed 32-bit number without a
decimal point

When a numerical value without a decimal point is required, that will have a maximum
value of 2,147,483,647.

Describe Long and when to use it correct answers A 64-bit number without a decimal
point

When a large numerical value without a decimal point is required, that will have a
maximum value of 2^63 - 1 and a minimum value of -2^63.

Describe Object and when to use it correct answers Data type used to represent any
data type supported by Apex, such as primitive data types, sObjects and user-defined
classes

When a declared object needs to be cast to a specific data type. For example, String s =
(String)obj;

Describe String and when to use it correct answers A String can be declared as any set
of characters surrounded by single quotes.

Example: String variableName;String variableName = 'value';

,Describe Time and when to use it correct answers A Time variable can be declared
using the new Instance(hour, minutes, seconds, milliseconds)method of the Time class.

Example: Time t = Time.newInstance(7, 30, 50, 500);

Describe List and when to use it correct answers An ordered collection of elements that
can be distinguished by their indices. Any supported data type can be used for lists

When several elements of a particular data type need to be stored in a specific order.

Describe Set and when to use it correct answers An unordered collection of elements
that do not contain any duplicates; Set elements can be of any supported data type.

When unique elements of a particular data type need to be stored in no specific order.

Describe Map and when to use it correct answers A collection of key-value pairs, where
each key maps to a single value; Map elements can be of any supported data type.

When data needs to be stored and accessed using identifiers or keys. For example, IDs
and names of account records can be stored as key-value pairs for easier manipulation
in Apex.

Describe Map and when to use it correct answers An abstract data type that takes one
value from a predefined set of values

When a variable should only have one of a set of predefined values. For example, it can
be used for specifying all the possible locations of a business in a country, out of which
a specific location can be used in Apex.

Describe sObject and when to use it correct answers A generic or specific sObject
variable that represents a row of data with fields

An sObject variable can be used for storing a record of standard or custom object.

Describe Class Object and when to use it correct answers An object created for a user-
defined or system-supplied Apex class

When an object of a class needs to be instantiated in order to access non-static
methods and variables of the class.

Define how Apex is a "strongly-typed" language correct answers Apex is a strongly-
typed language where the data type must be declared before a variable can be used.

Define a Constant correct answers Constant is a variable whose value cannot change
after it has been assigned a value.

, What is the default sharing setting for Apex classes? correct answers "without sharing"

State the inherited behavior of inner classes from container classes correct answers
Inner classes do not inherit the sharing setting from their container class.

How would a developer write a query to return the number of leads for each lead
source?

A. SELECT COUNT(LeadSource) FROM Lead
B. SELECT LeadSource, COUNT(Name) FROM Lead GROUP BY LeadSource
C. SELECT COUNT(*) FROM Lead GROUP BY LeadSource
D. SELECT GROUP(LeadSource) FROM Lead correct answers B. SELECT
LeadSource, COUNT(Name) FROM Lead GROUP BY LeadSource

A GROPU BY clause can be used with COUNT(fieldName) to allow analyzing records
and returning summary reporting information.

How can a developer check if a user has read access to a field and the field can be
displayed on a Vf page?

A. Call the isAccessible() method of Schema.DescribeFieldResult to verify field level
read permission
B. Call the isViewable() method of Schema.DescribeFieldResult to verify field level read
permission
C. Call the isReadable() method of Schema.SObjectResult to verify field level read
permission
D. Call the IsAccessible() method of Schema.DescribeSObjectResult to verify field level
read permission correct answers A. Call the isAccessible() method of
Schema.DescribeFieldResult to verify field level read permission

The isAccessible method of Schema.DescribeFieldResult can be called to check the
current user's read access for a field

How can a developer access a static variable named TaxRate declared in a different
Apex class named TaxCalculation?

A. (new TaxCalculation()).TaxRate()
B. (new TaxCalculation()).TaxRate
C. TaxCalculation.TaxRate()
D. TaxCalculation.TaxRate correct answers D. TaxCalculation.TaxRate

Static variables declared in an Apex class can be directly accessed without instantiating
using the following syntax: ClassName.StaticVariableName. A static method or variable
does not require an instance of the class in order to run. Static variables are not
methods, so no parentheses are needed.

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller HopeJewels. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $12.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

85651 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$12.99
  • (0)
  Add to cart