Objective-C Test

Objective-C Test

 

What is true regarding @protected?

a. The instance variable is accessible within the class that declares it and within classes that inherit it
b. The instance variable is accessible everywhere
c. The instance variable is accessible only within the class that declares it.
d. This is analogous to private_extern for variables and functions. Any code outside the class implementation’s image that tries to use the instance variable will get a link error
e. None of the above


What is a @finally block?

a. A block that is executed when the program quits
b. A block that is executed within a dynamic library when it’s unloaded
c. A block of code that is run whenever an exception is thrown or not
d. None of the above


What class specifiers are supported?

a. FINAL
b. STATIC
c. FAST
d. ITERATIVE
e. There is no such thing as class specifiers


A class can conform to only one protocol.

a. True
b. False


What is nil?

a. The null object
b. The null class
c. It doesn’t exist
d. None of the above


How do you throw an exception?

a. Raise Exception
b. @throw exception
c. RAISE exception
d. THROW exception
e. None of the above


Can an exception caught in @catch be re-thrown?

a. Yes
b. No


What does the following imply?

Worker *ceo = [[Worker alloc] init];
ceo->boss = nil;

a. That the ceo object is statically typed
b. That the boss instance variable is declared @protected
c. That the boss instance variable is declared @public
d. That the ceo is in fact a structure
e. This code is not correct


Prev1 of 4

Share This Post