Apex Non Developers Flashcards

1
Q

Attributes

A

Which describe properties (nouns or adjectives). They are characteristics of the class

access modifier, data type, unique name
public String name;
public String height;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Methods

A

Which describe behavior (verbs)

Actions performed by a class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Methods of the human class

A

Walk, Talk, work

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Attributes of the human class

A

Toes, Fingers, Hands, Name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Instantiation

A

Creating an object from a class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Instantiation requires?

A

class name,
object name,
new keyword,
class name with parentheses

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Method declaration syntax includes

A
An access modifier,
a data type or void, 
a unique method name, 
a pair of parentheses, 
a code block with curly braces

public void walk(){
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Attribute declaration syntax includes

A

An access modifier, a data type, a unique name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A Method can either return?

A

1) Void or
2) A single data type: which could be a collection
- -Use the return keyword to pass back a value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Primitives

A

basic building blocks and cannot be broken down

String firstname = ‘Adam’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Composites

A

Non-primitive data types that are built from other data types. Often see the keyword new.

Human man1 = new Human();
Human woman1 - new Human();
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

A Method can either return?

A

Void or
A single data type: which could be a collection
–Use the return keyword to pass back a value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When you see a composite being declared what do you usually see?

A

the keyword new

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you pass in parameters to a method

A

You can pass attributes as parameters into a method inside of the ()
The method declaration must supply:
1)a data type that indicates what type of data the method should expect
2)a local variable name that will accept the incoming data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Instantiate an object from the BankAcct class called chkAcct

A

chkAcct BankAcct = new chkAcct();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Set the attribute accttype of the object chkAcct to Checking

A

chkAcct.accttype = ‘Checking’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Set the attribute acctName of the object chkAcct to D.Castillo-Chk

A

chkAcct.acctName = ‘D.Castillo-Chk’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Invoke the makeDeposit method for $150

A

chkAcct.makeDeposit(150);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is a list?

A

An ordered collection of data of one data type distinguished by its index

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Each element in a list contains what 2 pieces of information

A

An index: an integer that always starts at 0

A value: The data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Whenever you’re looking at a parentheses you’re looking at

A

A Method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Declare a method that does not return anything and takes one input parameter of a Candidate list object called candsFromTrigger

A

public void createContact (List candsFromTrigger){

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What does the List for loop do?

A

It iterates over all of the elements in a list one by one with the help of an iteration variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What is an sObject?

A

standard or custom objects that store record data in the force.com database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
How do developers refer to sObjects and fields
By API names
27
An sObject variable represents
a row of data and can only be declared in Apex using the SOAP API name of the object
28
Instantiate an sObject
Account a = new Account();
29
DML Operations
``` saving changes to records in the database Insert Update Upsert Delete ```
30
DML can operate on?
A single sObject or a list of sObject
31
Database.insert
Database is the class. .insert is the method
32
Instantiate an object called acct from the sObject Account class
Account acct = new Account();
33
Set the attribute name of the acct object to Recruiting
acct.name='Recruiting';
34
Instantiate an object called heese from the sObject Account class
Account heese = new Account();
35
SOQL
Salesforce Object Query Language
36
What is the difference between SOQL and SQL
It's querying sObjects which is an abstraction layer away from the Database
37
What can SOQL expressions return
A single record A list of records An Integer, when using an aggregate function across records
38
What is a trigger
an apex script that executes before or after a DML operation on a single sObject
39
What do triggers have that determine when the trigger will execute
Before and After events
40
What is Trigger.new and Trigger.old
Attributes that provide access to the old and new versions of the sObject records. Trigger is a class.
41
Triggers execute when
Records are saved through the UI or Web Services API
42
Instantiate an object called cc from the class CreateContactFromCan
CreateContactFromCan cc = new CreateContactFromCan();
43
Declare a method that does not return anything called createContact
public void createContact (){ | }
44
Instantiate an object from the BankAcct class called chkAcct
BankAcct chkAcct = new BankAcct();
45
Set the attribute accttype of the object chkAcct to Checking
chkAcct.accttype = 'Checking';
46
Instantiate an object from the BankAcct class called savAcct
BankAcct savAcct = new BankAcct();
47
Instantiate an BankAcct List object from the List class called bankAccts
List bankAccts = new List();
48
Add the chkAcct object to the bankAccts list
bankAccts.add(chkAcct);
49
Instantiate a Contact list object from the List class
List conList = new List();
50
Declare a For List loop to loop through the list bankAccts with an iterationvariable called tempacct
For (BankAcct tempacct:bankAccts){
51
Declare a For list loop to loop through the input parameter list candsFromTrigger with an iterationvariable called currentCandidate
for(Candidate__c currentCandidate:candsFromTrigger){
52
Instantiate an object called acct from the sObject Account class
Account acct = new Account();
53
Set the attribute name of the acct object to Recruiting
acct.name='Recruiting';
54
Persist the acct object to the DB using DML
Database.insert(acct);
55
Instantiate an object called con from the sObject class contact
Contact con = new Contact()
56
Add the con object to the conList
conList.add(con);
57
Instantiate an object called cc from the class CreateContactFromCan
CreateContactFromCan cc = new CreateContactFromCan();
58
Declare a private integer attribute called balance initalize to zero
private integer balance=0;
59
Declare a method named makeDeposit that does not return anything and one input parameter of type integer called deposit
public void makeDeposit (integer deposit){
60
Declare a method named getBalance that returns an integer and no input parameter
public integer getBalance(){
61
What is system.debug
A special method that you can add to your code to generate output when your code is executed to provide feedback for the developer
62
Object Oriented Languages are based off
Classes
63
What is the abstract the intangible?
Class
64
Classes are where you define
Attributes and Methods
65
What are classes?
Blueprints used to create objects in Code. Start with a capital Letter
66
How are objects created from classes?
Insantiation. Human man1 = New Human() class name, object name, new keyword, class name with()
67
Attributes start with?
A lowercase letter
68
Primitive data type examples
``` Boolean Integer Date String ID Blob Enum ```
69
Where does Apex operate?
In memory, separate from the database
70
What persists data to the database?
DML
71
Object names starts with?
A lowercase letter
72
Where does Apex run
in Memory on the application server
73
A method always has what at the end?
Parens ()
74
Each element in a list always contains?
An index that always starts at zero and a value
75
List for loop syntax
``` for (iterationVariableDataType iterationVariable : list){ //code } ``` for(String currentname : studentList){ }
76
Whats another way of thinking about list for loops
For each element in my list loop
77
IterationVariableDataType is always what data type
The data type of your list
78
Whats the syntax for list for loops
for(type of List currentStudent :StudentList){ | }
79
Attributes are similar to
Fields
80
Instantiate an object is the equivalent of
Creating a new record in the UI
81
What map method do you use to get a set of all of the keys
keySet
82
What map method reruns a list of values in the map
values
83
Trigger.new
Trigger is a class. New is an attribute
84
An object is?
An Instance of a class
85
Trigger.new returns
a list of the new versions of sObjects
86
Trigger.old returns
a list of the old versions of sObjecfts