wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Salesforce Exception Handling Quiz

Total questions: 10

Worksheet time: 2mins

Name
Class
Date
1.

Best Practices for Exception Handling in Apex

a)

Never just catch Exception

b)

Exceptions in Apex should be handled carefully

c)

Use the System.SavePoint() and Database.rollback() functions

d)

All of the Above

2.

Exception handlers are declared with ____________ keyword.

a)

Catch

b)

Try

c)

throw

d)

finally

3.

What keyword is used to explicitly raise a exception?

a)

catch

b)

throw

c)

throws

d)

raise

4.

Choose Standard Apex Exception Types (Select Any Two)

a)

LimitException

b)

ReportException

c)

MyApexClassException

d)

QueryException

5.

Reasons that cause an exception :

a)

The developer is trying to write wrong syntax

b)

The developer is trying to reference a null object

c)

The developer is not added try catch block in code

d)

The developer is performing some DML and it fails

6.

Which of these keywords is not a part of exception handling?

a)

try

b)

finally

c)

thrown

d)

catch

7.

What Causes Exceptions?

a)

DmlException

b)

QueryException

c)

NullPointerException

d)

All of the Above

8.

The code within the ----------- block will always be executed whether or not an exception is thrown

a)

try

b)

catch

c)

finally

d)

throw

9.

What has happened during the fault, “UNKNOWN_EXCEPTION”?

a)

The system has encountered a breach

b)

The system has encountered an internal error

c)

The system has encountered a hardware issue

d)

The system has encountered data loss

10.

When this Exception occurs : List index out of bounds: 0?

a)

ArithmeticException

b)

System.ListException

c)

IllegalArgumentException

d)

ArrayStoreException