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
Q

How do developers refer to sObjects and fields

A

By API names

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

An sObject variable represents

A

a row of data and can only be declared in Apex using the SOAP API name of the object

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

Instantiate an sObject

A

Account a = new Account();

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

DML Operations

A
saving changes to records in the database
Insert
Update
Upsert
Delete
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

DML can operate on?

A

A single sObject or a list of sObject

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

Database.insert

A

Database is the class. .insert is the method

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

Instantiate an object called acct from the sObject Account class

A

Account acct = new Account();

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

Set the attribute name of the acct object to Recruiting

A

acct.name=’Recruiting’;

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

Instantiate an object called heese from the sObject Account class

A

Account heese = new Account();

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

SOQL

A

Salesforce Object Query Language

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

What is the difference between SOQL and SQL

A

It’s querying sObjects which is an abstraction layer away from the Database

37
Q

What can SOQL expressions return

A

A single record
A list of records
An Integer, when using an aggregate function across records

38
Q

What is a trigger

A

an apex script that executes before or after a DML operation on a single sObject

39
Q

What do triggers have that determine when the trigger will execute

A

Before and After events

40
Q

What is Trigger.new and Trigger.old

A

Attributes that provide access to the old and new versions of the sObject records. Trigger is a class.

41
Q

Triggers execute when

A

Records are saved through the UI or Web Services API

42
Q

Instantiate an object called cc from the class CreateContactFromCan

A

CreateContactFromCan cc = new CreateContactFromCan();

43
Q

Declare a method that does not return anything called createContact

A

public void createContact (){

}

44
Q

Instantiate an object from the BankAcct class called chkAcct

A

BankAcct chkAcct = new BankAcct();

45
Q

Set the attribute accttype of the object chkAcct to Checking

A

chkAcct.accttype = ‘Checking’;

46
Q

Instantiate an object from the BankAcct class called savAcct

A

BankAcct savAcct = new BankAcct();

47
Q

Instantiate an BankAcct List object from the List class called bankAccts

A

List bankAccts = new List();

48
Q

Add the chkAcct object to the bankAccts list

A

bankAccts.add(chkAcct);

49
Q

Instantiate a Contact list object from the List class

A

List conList = new List();

50
Q

Declare a For List loop to loop through the list bankAccts with an iterationvariable called tempacct

A

For (BankAcct tempacct:bankAccts){

51
Q

Declare a For list loop to loop through the input parameter list candsFromTrigger with an iterationvariable called currentCandidate

A

for(Candidate__c currentCandidate:candsFromTrigger){

52
Q

Instantiate an object called acct from the sObject Account class

A

Account acct = new Account();

53
Q

Set the attribute name of the acct object to Recruiting

A

acct.name=’Recruiting’;

54
Q

Persist the acct object to the DB using DML

A

Database.insert(acct);

55
Q

Instantiate an object called con from the sObject class contact

A

Contact con = new Contact()

56
Q

Add the con object to the conList

A

conList.add(con);

57
Q

Instantiate an object called cc from the class CreateContactFromCan

A

CreateContactFromCan cc = new CreateContactFromCan();

58
Q

Declare a private integer attribute called balance initalize to zero

A

private integer balance=0;

59
Q

Declare a method named makeDeposit that does not return anything and one input parameter of type integer called deposit

A

public void makeDeposit (integer deposit){

60
Q

Declare a method named getBalance that returns an integer and no input parameter

A

public integer getBalance(){

61
Q

What is system.debug

A

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
Q

Object Oriented Languages are based off

A

Classes

63
Q

What is the abstract the intangible?

A

Class

64
Q

Classes are where you define

A

Attributes and Methods

65
Q

What are classes?

A

Blueprints used to create objects in Code. Start with a capital Letter

66
Q

How are objects created from classes?

A

Insantiation.
Human man1 = New Human()

class name, object name, new keyword, class name with()

67
Q

Attributes start with?

A

A lowercase letter

68
Q

Primitive data type examples

A
Boolean
Integer
Date
String
ID
Blob
Enum
69
Q

Where does Apex operate?

A

In memory, separate from the database

70
Q

What persists data to the database?

A

DML

71
Q

Object names starts with?

A

A lowercase letter

72
Q

Where does Apex run

A

in Memory on the application server

73
Q

A method always has what at the end?

A

Parens ()

74
Q

Each element in a list always contains?

A

An index that always starts at zero and a value

75
Q

List for loop syntax

A
for (iterationVariableDataType iterationVariable : list){
//code
}

for(String currentname : studentList){
}

76
Q

Whats another way of thinking about list for loops

A

For each element in my list loop

77
Q

IterationVariableDataType is always what data type

A

The data type of your list

78
Q

Whats the syntax for list for loops

A

for(type of List currentStudent :StudentList){

}

79
Q

Attributes are similar to

A

Fields

80
Q

Instantiate an object is the equivalent of

A

Creating a new record in the UI

81
Q

What map method do you use to get a set of all of the keys

A

keySet

82
Q

What map method reruns a list of values in the map

A

values

83
Q

Trigger.new

A

Trigger is a class. New is an attribute

84
Q

An object is?

A

An Instance of a class

85
Q

Trigger.new returns

A

a list of the new versions of sObjects

86
Q

Trigger.old returns

A

a list of the old versions of sObjecfts