C Programming

This test contains the basic and advanced question related to Objective C. This test is useful for CS/GATE and other students.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following is not a restriction in Posing in Objective-C?

  1. A posing class can call overridden methods through super keyword.
  2. The posing class must not define any new instance variables other than target class.
  3. A posing class can not override methods defined in the categories.
  4. The target class is unaware of any information about posing class.
  5. A class may only pose as one of its direct or indirect super classes.
Question 2 Multiple Choice (Single Answer)

Which of the following information is not included in NSError object?

  1. Domain
  2. Code
  3. User info
  4. Application specific information
  5. Implemented code
Question 3 Multiple Choice (Single Answer)

Which of the following is an incorrect statement about NSSet in Objective C?

  1. It has distinct objects.
  2. It is immutable.
  3. It is used to store and retrieve primitive values.
  4. The elements can be altered in NSSet.
  5. An NSSet can be created through the set with objects: class method.
Question 4 Multiple Choice (Single Answer)

Which of the following is an incorrect statement about the NSNumber class in Objective C?

  1. It is a lightweight class.
  2. It is used to store and retrieve primitive values.
  3. %@ format specifier is used for this class.
  4. NSNumber objects are immutable.
  5. The NSNumber object can be made mutable.
Question 5 Multiple Choice (Single Answer)

Which of the following is an incorrect statement about data encapsulation in Objective-C?

  1. It contains program statements.
  2. It contains program data.
  3. It binds data and functions.
  4. Dynamic binding is also possible in data encapsulation.
  5. This property has all private variables in the code.
Question 6 Multiple Choice (Single Answer)

Which of the following is a false statement about 'properties' in Objective C?

  1. These are used to declare the data of a class.
  2. The most commonly used parameters are copy/retain/assign in the Property.
  3. The assign keyword generates a setter, which do not have retained objects.
  4. The assign can be interchanged with another object's property.
  5. The read-only keyword is used to generate the setters.
Question 7 Multiple Choice (Single Answer)

Which of the following is a false statement about the synthesised property?

  1. It is used to implement the code for the accessors.
  2. Synthesised accessors are atomic.
  3. Synthesised accessors can not be nonatomic.
  4. The getters must have a value as per the setters.
  5. There is no cost for the synthesised property if garbage collection is enabled.
Question 8 Multiple Choice (Single Answer)

Which of the following is an incorrect statement about garbage collection (GC) in Objective C?

  1. Garbage collection reduces the effect of memory management methods.
  2. The dealloc method can not be called during GC.
  3. The methods like copy and mutable copy messages, copy the value of the object in case GC is enabled.
  4. The final method can not be implemented if GC is enabled.
  5. Garbage collection is off by default.
Question 9 Multiple Choice (Single Answer)

Which of the following is an incorrect statement about using the protocols in Objective C?

  1. These are used to declare methods for others to implement.
  2. These are used to declare the interfaces to a particular class.
  3. Protocols establish the common attributes among the classes in different hierarchy.
  4. Protocols manage the execution state of the application.
  5. Protocols play an important role in OS X and iOS development.
Question 10 Multiple Choice (Single Answer)

Which of the following Class Clusters are in Objective C?

  1. These are used to maintain a common abstract superclass for all the subclasses.
  2. These provide the specific values based on the inputs for all the subclasses.
  3. The abstract class for the Cluster can not be defined with the composite object.
  4. Bool is a Cluster class of NSNumber.
  5. It uses the functionality like abstract factory.
Question 11 Multiple Choice (Single Answer)

Which of the following is an incorrect statement about reference counting in Objective C memory management?

  1. Each object must have a value.
  2. Initially the count is set to 1.
  3. The objects can be accessed at zero count.
  4. When the count hits zero, the object is immediately freed from memory.
  5. The actions will increment or decrement this count.
Question 12 Multiple Choice (Single Answer)

Which of the following is a correct statement about 'autorelease' in Objective C?

  1. It acts as a medium between the memory system and the garbage collection.
  2. All the released objects are included in the autorelease pool.
  3. All of the objects must be passed in a method pool.
  4. Some objects can be forced to autorelease.
  5. Every program must create its own object.
Question 13 Multiple Choice (Single Answer)

Which of the following is an incorrect statement about Automatic Reference Counting (ARC) in Objective C?

  1. The release and retain of the methods are done automatically.
  2. The release and retain of the methods are done automatically as well as manually.
  3. There is low memory leak.
  4. Reference counting works in this approach.
  5. It uses the same reference counting system as (Manual Retain-Release) MRR.
Question 14 Multiple Choice (Single Answer)

Which of the following is not a characteristic of the Objective C category?

  1. A category can be declared for any class in the source code.
  2. It cannot be declared for any class, only for the classes that have original implementation of source code.
  3. All the methods in a category should be applicable to all the instances of the class.
  4. All the methods in a category should be applicable to all subclasses of the original class.
  5. At runtime, there's no difference between a method added by a category with its implementation.
Question 15 Multiple Choice (Single Answer)

Which of the following is not a characteristic of Extensions in Objective-C?

  1. An Extension can be declared for any class in the source code.
  2. It cannot be declared for any class in the source code.
  3. Extensions are also known as anonymous categories.
  4. The methods and variables declared inside the extensions are not accessible to the child classes.
  5. @interface keyword is used to declare the extension.