Upwork Test Answers: Get all the correct answers of most recent and possible Upwork Tests A to Z (Updated on Jan, 2016)
Cover Letter Templates: These cover letter samples are not only for Upwork job, but also you will have some idea about your real life job
 
Freelance Profile Overviews: Different Profile samples and overviews of experts, advanced and intermediate level freelancers
For Newbie of Upwork: Upwork Help - How to apply for a job in Upwork with 10 most important articles about Upwork

A to Z View - All Upwork Test Answers

Objective-C Test Answers (new)

Here you will have Objective-C Test Answers of Upwork General Programming Category, please press Ctrl + F to find your desired answers of test questions.
--------------------------------------------------------------------------------------------------------------------------

1. What comments are supported in Obj-C?
 Answers: • // Line comments or • /* Block comments */

 2. What is a protocol?
 Answers: • An interface without an implementation

 3. What is the isa variable in objects?
 Answers: • Object class identification

 4. In which version of Objective-C did the fast enumeration system appear?
 Answers: • 2.0

 5. What is an IMP?
 Answers: • The C type of a method implementation pointe

 6. What is the default visibility for instance variables?
 Answers: • @protected

 7. What type of variable do you need to use to implement singletons?
 Answers: • static

 8. What is a category?
 Answers: • A category is a way to add methods to a class which already exists


 9. How do you allocate an object?
 Answers: • MyClass *obj = [MyClass alloc];

 10. Is the following code a correct allocation?


 MyClass myObj;

 [&myObj aMessage];
 Answers: • No

 11. What is an autoreleased object?
 Answers: • An object that will be released when the current AutoreleasePool is deallocated.

 12. Which of the following declares a protocol?
 Answers: • @protocol ProtocolName

 13. In which version of Objective-C did the properties system appear?
 Answers: • 2.0

 14. What is the id type?
 Answers: • A generic C type that Objective-C uses for an arbitrary object

 15. When using the garbage collector, which method, that is normally called without the collector, is not called on your objects where they are collected?
 Answers: • dealloc

 16. Which of the following creates a class that conforms to a protocol?
 Answers: • @interface ClassName <ProtocolName>

 17. What is a @finally block?
 Answers: • A block of code that is run whenever an exception is thrown or not

 18. What is true regarding @protected?
 Answers: • The instance variable is accessible within the class that declares it and within classes that inherit it

 19. A class can conform to only one protocol.
 Answers: • False

 20. What class specifiers are supported?
 Answers: • There is no such thing as class specifiers

 21. How do you throw an exception?
 Answers: • @throw exception

 22. What is nil?
 Answers: • The null object

 23. What does the following imply?

 Worker *ceo = [[Worker alloc] init];
 ceo->boss = nil;
 Answers: • That the boss instance variable is declared @public

 24. Can an exception caught in @catch be re-thrown?
 Answers: • Yes

 25. What is true regarding @public?
 Answers: • None of the above

 26. Which of the following is false?
 Answers: • When a method is called, the send is automatically available as the sender variable, like self or supe

 27. What can you use to avoid the msgSend function overhead?
 Answers: • IMP

 28. What does Obj-C not support?
 Answers: • Automatic variables

 29. What is not supported in Obj-C?
 Answers: • Method argument default value

 30. What will be the output of the following code?


 static int

 a (void)

 {

 printf ("a\n");

 return 0;

 }


 static int

 b (void)

 {

 printf ("b\n");

 return 1;

 }


 static int

 c (void)

 {

 printf ("c\n");

 return 2;

 }


 int

 main (int argc, const char *argv[])

 {

 printf ("%d %d %d", a (), b (), c ());

 return 0;

 }
 Answers: • c b a 0 1 2

No comments:

Post a Comment