1.
What was Objective-C for Apple back in the 1980s?
Correct Answer
D. Apple's main programming language
Explanation
Objective-C was Apple's main programming language in the 1980s. It was not a language that wasn't used at all or stolen from Apple's opponent. It was also not Apple's second created language. Objective-C was widely used by Apple for developing software and applications during that time period.
2.
What's the filename extension for implementation program files?
Correct Answer
A. .m
Explanation
The filename extension for implementation program files is .m. This extension is commonly used in programming languages such as Objective-C and MATLAB to denote implementation files. These files contain the actual code and logic that make up the program. By using the .m extension, it is easier for developers and compilers to identify and differentiate these files from other types of files in the project.
3.
What's "Objective-C without the C"?
Correct Answer
D. Swift
Explanation
Swift is the correct answer because it is known as "Objective-C without the C." Swift is a programming language developed by Apple that is designed to be more modern, safe, and easier to use than Objective-C. It is compatible with Objective-C and can be used alongside it in iOS and macOS development. Swift eliminates the need for many of the complex and error-prone features of Objective-C, making it a more streamlined and efficient language for developing applications.
4.
Where does Objective-C derive its object syntax from?
Correct Answer
A. Smalltalk
Explanation
Objective-C derives its object syntax from Smalltalk. Smalltalk is an object-oriented programming language that was developed in the 1970s. Objective-C, which was created in the 1980s, borrowed many of its object-oriented features and syntax from Smalltalk. This includes concepts such as message passing, dynamic typing, and the use of square brackets for method calls. By incorporating Smalltalk's object syntax, Objective-C was able to provide a powerful and flexible programming language for developing software applications.
5.
What's Objective-C model of object-oriented programming based on?
Correct Answer
B. Message passing to object instances
Explanation
Objective-C model of object-oriented programming is based on message passing to object instances. In Objective-C, objects communicate with each other by sending messages. When a message is sent to an object, the object's method corresponding to that message is executed. This allows objects to interact and collaborate with each other, forming the basis of object-oriented programming in Objective-C.
6.
What do you use to write methods?
Correct Answer
D. Interface declarations
Explanation
Interface declarations are used to define methods in programming. An interface is a collection of abstract methods that can be implemented by classes. By using interface declarations, programmers can define the methods that need to be implemented by a class, without specifying how they should be implemented. This allows for code reusability and ensures that classes implementing the interface have the required methods. Therefore, interface declarations are the correct choice for writing methods.
7.
What does syntax allow?
Correct Answer
C. Pseudo-naming of arguments
Explanation
Syntax allows for the pseudo-naming of arguments. This means that when writing code, you can use descriptive names for the arguments instead of the actual variable names. This can make the code more readable and easier to understand for both the programmer and other individuals who may need to work with the code. Pseudo-naming of arguments is a feature provided by the syntax of programming languages.
8.
Which protocols does Objective-C use?
Correct Answer
C. Informal and formal protocols
Explanation
Objective-C uses both informal and formal protocols. Informal protocols are a way to define a set of methods that objects can choose to implement, providing a flexible way to extend functionality. Formal protocols, on the other hand, are a more structured approach where a set of methods must be implemented by conforming objects. By supporting both types of protocols, Objective-C allows developers to choose the level of flexibility and structure they need in their code.
9.
Which statement is true?
Correct Answer
D. Objective-C can send messages to an object that may not respond
Explanation
Objective-C can send messages to an object that may not respond. This means that Objective-C allows for the sending of messages to an object without requiring the object to have a defined response or method implementation. This flexibility allows for dynamic messaging and handling of potential errors or unexpected scenarios in Objective-C programming.
10.
What is posing?
Correct Answer
A. Permitting a class to replace another class withing a program
Explanation
Posing refers to the act of allowing a class to replace another class within a program. This means that one class can take on the functionality and behavior of another class, providing flexibility and customization options within the program. This concept is often used in object-oriented programming to facilitate easier modifications and updates to the program's code.