A class can conform to only one protocol.
A class can have two methods with the same name, but with different argument types.
A method can be tagged to be called only by a specific class and its subclasses.
As categories can't have instance variables, what class could you use to implement a full class only with categories?
NSArray 0.0%
NSMutableDictionary 72.0%
NSSet 4.0%
None of the above 24.0%
Can an exception caught in @catch be re-thrown?
Can you send messages to nil?
How do you allocate an object?
MyClass *obj = malloc(sizeof(MyClass)); 7.0%
MyClass *obj = [MyClass alloc]; 92.0%
MyClass *obj = alloc(MyClass); 0.0%
MyClass *obj = [MyClass new]; 0.0%
None of the above 0.0%
How do you free an object?
free(obj) 4.0%
[obj dealloc] 0.0%
[obj release] 95.0%
[obj free] 0.0%
None of the above 0.0%
How do you include the root "Object" class?
#include <Object.h> 0.0%
#include <objc/Object.h> 25.0%
#include <Object/Object.h> 0.0%
#include <ROOT.h> 4.0%
It depends on the compiler 70.0%
How do you throw an exception?
raise Exception 0.0%
@throw exception 95.0%
THROW exception 4.0%
None of the above 0.0%
If you need to allocate custom memory, in which method will you do so?
+ alloc 13.0%
- alloc 4.0%
+ init 0.0%
- init 4.0%
None of the above 78.0%
In Obj-C 2.0, what do the fast enumeration protocols rely on to provide fast Enumerations?
C arrays 95.0%
Java Vectors 4.0%
Ruby hash 0.0%
Obj-C Array 0.0%
None of the above 0.0%
In which version of Objective-C did the fast enumeration system appear?
2.0 95.0%
1.5 0.0%
1.0 0.0%
3.0 4.0%
In which version of Objective-C did the properties system appear?
3.0 0.0%
2.5 0.0%
2.0 86.0%
1.5 4.0%
1.0 9.0%
Is the following code a correct allocation? MyClass myObj; [&myObj aMessage];
Protocols are like classes; they can inherit.
What are @try and @catch?
Exception handlers 20.0%
Exceptions 0.0%
Exception keywords 79.0%
All of the above 0.0%
What can be linked to an Obj-C program without any particular process?
C libraries 62.0%
Java jar files 0.0%
C++ libraries 37.0%
scripts 0.0%
Executables 0.0%
What can be used as Object instance variables?
int 20.0%
structures 23.0%
pointers 36.0%
unions 20.0%
None of the above 0.0%
What can you do with categories?
Add instance variables to a class without subclassing it 0.0%
Add methods to a class without subclassing it 59.0%
Override methods of a class without subclassing it 40.0%
None of the above 0.0%
What can you use to avoid the msgSend function overhead?
SEL 65.0%
IMP 34.0%
You can't use anything 0.0%
None of the above 0.0%
What class specifiers are supported?
FINAL 4.0%
STATIC 13.0%
FAST 0.0%
ITERATIVE 0.0%
There is no such thing as class specifiers 81.0%
What comments are supported in Obj-C?
// Line comments 52.0%
/* Block comments */ 47.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 36.0%
Static variables 0.0%
Automatic variables 63.0%
What does the following imply? Worker *ceo = [[Worker alloc] init]; ceo->boss = nil;
That the ceo object is statically typed 7.0%
That the boss instance variable is declared @protected 0.0%
That the boss instance variable is declared @public 71.0%
That the ceo is in fact a structure 21.0%
This code is not correct 0.0%
What happens if two categories define methods with the same names for the same class?
The code won't compile 0.0%
At runtime, either method will be called 100.0%
A runtime exception will be thrown 0.0%
None of the above 0.0%
What happens if you release an unretained object twice?
Nothing, too many releases are handled correctly 0.0%
Undefined behaviour 22.0%
MemoryException is raised 77.0%
None of the above 0.0%
What is #import
A namespace import rule 0.0%
A namespace definition 0.0%
A recursive include 0.0%
C preprocessor construct to avoid multiple inclusions of the same file 100.0%
None of the above 0.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 100.0%
None of the above 0.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 a SEL?
A selection 0.0%
The C type of a message selector 47.0%
The C type of a class 0.0%
A pointer to a method 52.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 0.0%
A preprocessor directive defined to the implementation name 0.0%
The C type of a method implementation pointer 100.0%
None of the above 0.0%
What is nil?
The null object 94.0%
The null class 0.0%
It doesn't exist 0.0%
None of the above 5.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 C type used to work with objects in Obj-C?
int 0.0%
structure 0.0%
pointer 100.0%
array 0.0%
What is the default visibility for instance variables?
@private 26.0%
@package 0.0%
@public 0.0%
@protected 73.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 0.0%
A type to hold serialized objects 0.0%
The type used for Classes 0.0%
None of the above 11.0%
What is the isa variable in objects?
Object size 0.0%
Object memory footprint 0.0%
Object class identification 100.0%
Object serial number 0.0%
None of the above 0.0%
What is the Obj-C runtime?
A C library 94.0%
A compiler 0.0%
A language 0.0%
A dynamic loader 5.0%
What is true regarding @protected?
The instance variable is accessible within the class that declares it and within classes that inherit it 68.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 31.0%
None of the above 0.0%
What is true regarding @public?
It doesn't exist in Objective-C 0.0%
It breaks encapsulation 88.0%
It can be used only on singleton objects 0.0%
None of the above 11.0%
What is true regarding C functions inside .m files?
They can contain Obj-C code 56.0%
They are slower than if in a .c files 3.0%
They cannot use C libraries 3.0%
They can be static 36.0%
What is true regarding messaging?
Messaging is static and messages are replaced by function call at compile time 0.0%
Messaging is fully dynamic, which means you can compile some code that sends a message to a class that doesn't implement it, and add a category later, in a dynamic library for example 100.0%
Messaging is only a syntax sugar to call functions 0.0%
None of the above is true 0.0%
What is true regarding strings?
C string literals are automatically mapped to objects 0.0%
C string literals can be used in Obj-C 17.0%
Obj-C strings are not of static storage 82.0%
Obj-C strings are like C strings 0.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 ("c
"); return 2;...
a b c 0 1 2 80.0%
a b c 2 1 0 5.0%
c b a 0 1 2 15.0%
c b a 2 1 0 0.0%
None of the above 0.0%
What's the difference between copy and deepCopy?
They are the same 0.0%
deepCopy doesn't exist 11.0%
copy creates a copy at the first level, while deepCopy copies the instance variables 88.0%
copy creates a proxy object, while deepCopy allocate a new object 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 0.0%
dealloc 100.0%
destroy 0.0%
uninit 0.0%
Which C feature is not supported in Obj-C?
Bitfields 0.0%
Compound literals 0.0%
Structures 0.0%
C arrays 0.0%
Support is compiler dependant 100.0%
Which of the following can be inherited?
Categories 0.0%
Protocols 53.0%
Classes 46.0%
None of the above 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 does not happen when you throw an exception in a @synchronized block?
The object is deallocated 81.0%
The object is unlocked 0.0%
An exception is thrown 6.0%
None of the above 12.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 super 81.0%
Messages can be sent to nil 0.0%
Methods in static libraries must be present at link time 18.0%
Which of the following is incorrect?
[self release] 0.0%
[super release] 6.0%
[AClass release] 81.0%
They are all correct 12.0%
Which of the following is not recommended?
Adding an (id)sender argument to methods 0.0%
Using static variables inside methods 6.0%
Using C code inside Obj-C methods 13.0%
None of the above 80.0%
Which of the following is the fastest?
@synchronized 0.0%
Explicit locking 5.0%
Condition locking 5.0%
Mutex implicit locking 89.0%