A class can conform to only one protocol.
Can an exception caught in @catch be re-thrown?
How do you allocate an object?
MyClass *obj = malloc(sizeof(MyClass)); 0.0%
MyClass *obj = [MyClass alloc]; 92.0%
MyClass *obj = alloc(MyClass); 0.0%
MyClass *obj = [MyClass new]; 7.0%
None of the above 0.0%
How do you throw an exception?
Raise Exception 0.0%
@throw exception 83.0%
THROW exception 0.0%
None of the above 16.0%
In which version of Objective-C did the fast enumeration system appear?
2.0 100.0%
1.5 0.0%
1.0 0.0%
3.0 0.0%
In which version of Objective-C did the properties system appear?
3.0 0.0%
2.5 0.0%
2.0 100.0%
1.5 0.0%
1.0 0.0%
Is the following code a correct allocation? MyClass myObj; [&myObj aMessage];
What can you use to avoid the msgSend function overhead?
SEL 16.0%
IMP 83.0%
You can't use anything 0.0%
None of the above 0.0%
What class specifiers are supported?
FINAL 0.0%
STATIC 0.0%
FAST 0.0%
ITERATIVE 0.0%
There is no such thing as class specifiers 100.0%
What comments are supported in Obj-C?
// Line comments 50.0%
/* Block comments */ 50.0%
# Line comments 0.0%
; Line comments 0.0%
-[[ block comments ]] 0.0%
What does Obj-C not support?
Instance variables 0.0%
Class variables 30.0%
Static variables 0.0%
Automatic variables 70.0%
What does the following imply? Worker *ceo = [[Worker alloc] init]; ceo->boss = nil;
That the ceo object is statically typed 18.0%
That the boss instance variable is declared @protected 12.0%
That the boss instance variable is declared @public 37.0%
That the ceo is in fact a structure 12.0%
This code is not correct 18.0%
What is a @finally block?
A block that is executed when the program quits 0.0%
A block that is executed within a dynamic library when it's unloaded 0.0%
A block of code that is run whenever an exception is thrown or not 100.0%
None of the above 0.0%
What is a category?
A namespace 0.0%
A category is a way to add instance variables to a class which already exists 0.0%
A category is a group of classes 0.0%
A category is a way to add methods to a class which already exists 88.0%
None of the above 11.0%
What is a protocol?
A class that uses functions instead of methods 0.0%
A method signature 0.0%
A class signature 0.0%
An interface without an implementation 100.0%
None of the above 0.0%
What is an autoreleased object?
A C object. 0.0%
A static object. 0.0%
An object that is garbage collected. 0.0%
An object that will be released when the current AutoreleasePool is deallocated. 100.0%
None of the above 0.0%
What is an IMP?
A special type used for computation 0.0%
An alias for SEL 11.0%
A preprocessor directive defined to the implementation name 0.0%
The C type of a method implementation pointe 88.0%
None of the above 0.0%
What is nil?
The null object 88.0%
The null class 0.0%
It doesn't exist 0.0%
None of the above 11.0%
What is not supported in Obj-C?
Recursive method call 0.0%
Variable argument count to method 0.0%
Byte manipulation 0.0%
Method argument default value 100.0%
None of the above 0.0%
What is the default visibility for instance variables?
@private 0.0%
@package 0.0%
@public 30.0%
@protected 70.0%
None of the above 0.0%
What is the id type?
A generic C type that Objective-C uses for an arbitrary object 88.0%
A memory address type 11.0%
A type to hold serialized objects 0.0%
The type used for Classes 0.0%
None of the above 0.0%
What is the isa variable in objects?
Object size 0.0%
Object memory footprint 11.0%
Object class identification 88.0%
Object serial numbe 0.0%
None of the above 0.0%
What is true regarding @protected?
The instance variable is accessible within the class that declares it and within classes that inherit it 80.0%
The instance variable is accessible everywhere 0.0%
The instance variable is accessible only within the class that declares it. 0.0%
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 10.0%
None of the above 10.0%
What is true regarding @public?
It doesn't exist in Objective-C 0.0%
It breaks encapsulation 30.0%
It can be used only on singleton objects 0.0%
None of the above 70.0%
What type of variable do you need to use to implement singletons?
static 100.0%
auto 0.0%
const 0.0%
volatile 0.0%
What will be the output of the following code? static int a (void) { printf ("a
"); return 0; } static int b (void) { printf ("b
"); return 1; } static int c (void) { printf ("...
a b c 0 1 2 0.0%
a b c 2 1 0 0.0%
c b a 0 1 2 100.0%
c b a 2 1 0 0.0%
None of the above 0.0%
When using the garbage collector, which method, that is normally called without the collector, is not called on your objects where they are collected?
free 10.0%
dealloc 90.0%
destroy 0.0%
uninit 0.0%
Which of the following creates a class that conforms to a protocol?
@interface ClassName [ProtocolName] 0.0%
@interface ClassName <ProtocolName> 100.0%
@interface ClassName < ProtocolName 0.0%
@interface ClassName::ProtocolName 0.0%
@interface ClassName(ProtocolName) 0.0%
Which of the following declares a protocol?
@proto ProtocolName 0.0%
protocol ProtocolName {}; 0.0%
@protocol ProtocolName 100.0%
@interface <ProtocolName> 0.0%
@interface ProtocolName::Protocol 0.0%
Which of the following is false?
Method lookup is done at runtime 0.0%
When a method is called, the send is automatically available as the sender variable, like self or supe 90.0%
Messages can be sent to nil 0.0%
Methods in static libraries must be present at link time 10.0%