set-5
201. How many types of Container Adaptors are present?
A. 3 B. 4 C. 5 D. 6
202. How many types of associative containers are present?
A. 1 B. 2 C. 3 D. 4
203. How many Unordered Associative containers are present?
A. 2 B. 3 C. 4 D. 5
204. Unordered associative containers are containers that:
A. Implement unsorted (hashed) data structures for quick search in O(1) B. Implement sorted data structures that can be quickly searched (O(log n) complexity) C. Provide a different interface for sequential containers. D. All of the Above
205. A container adaptor is that:
A. Containers that implement unsorted (hashed) data structures for quick search in O(1) B. Implement sorted data structures that can be quickly searched (O(log n) complexity) C. Provide a different interface for sequential containers. D. All of the Above
206. An associative container is that:
A. Containers that implement unsorted (hashed) data structures for quick search in O(1) B. Implement sorted data structures that can be quickly searched (O(log n) complexity) C. Provide a different interface for sequential containers. D. All of the Above
207. Exception specification is:
A. A function is limited to throwing only a specified list of exceptions B. A function is allowed to throw all list of exceptions C. Both A & B D. A function can throw any type of exceptions
208. When a program throws any other type of exception other than specified, then?
A. Run B. Arises error C. No response D. Throw
209. No Exception specification means:
A. Throw Nothing B. Catch nothing C. Throw anything D. Catch anything
210. Which of the following operations does not throw anything?
A. Operations which are irreversible B. Operations which are reversible C. Operations which are continuous D. None of the Above
211. The ellipsis operator is used to:
A. Catch all handlers B. Throw all handlers C. Catch and throw all handlers D. None of the Above
212. When we move the try block far away from the catch block, then?
A. Reduces the amount of code in the cache B. Increases the amount of code in the cache C. Doesn’t alter anything D. All of the Above
213. It is expensive to use objects for exceptions because:
A. The exception object is created only if an error actually happens B. Large time and space C. Both A & B D. Large execution time
214. Iterators are used to:
A. Point to memory addresses of STL containers B. Iterate over pointers C. Iterate over C-like arrays D. All of the Above
215. Exception handling consists of how many keywords?
A. 2 B. 3 C. 4 D. 5
216. The advantages of exception handling are:
A. Separation of Error Handling code from Normal Code B. Functions/Methods can handle only the exceptions they choose C. Grouping of Error Types D. All of the Above
217. Which of the following statements is true?
A. Exceptions are runtime anomalies or abnormal conditions that a program encounters during its execution. B. Types of exceptions are synchronous and asynchronous C. Grouping of error types is an advantage of error handling D. All of the Above
218. Which of the following is used to catch all the exceptions?
A. Catch(.....) B. Catch(...) C. Catch() D. Catch(&)
219. Which of the following is used to handle exceptions in C++?
A. Catch B. Throw C. Exception D. Exception handler
220. In C++, what types of exceptions are available?
A. Static B. Dynamic C. Both A & B D. Unhandled
221. Which of the following is used to check the error in the block?
A. Try B. Catch C. Throw D. All of the Above
222. The C++ code which causes abnormal termination/behavior of a program should be written under:
A. Try B. Catch C. Throw D. Any one of the Above
223. What does a program do when it detects an exception?
A. Continue running B. Calls other functions of the program C. Results in the termination of the program D. None of the Above
224. What will happen if the try-catch block is not used?
A. Error will arise B. Error will not arise C. Program generates output D. None of the Above
225. We can take Exception in C++ as:
A. Divide by zero B. Variable not declared C. An expression is not complete D. All of the Above
226. Which of the following is correct?
A. Exceptions can be handled at runtime, but errors cannot B. There are two types of exceptions C. The throw keyword is used to throw an exception D. All of the Above
227. Rethrowing Means?
A. An exception that is thrown again as it is not handled by that catching block B. An exception that is caught twice C. An exception that is not handled in one caught hence thrown again D. All of the Above
228. What is encapsulation in object-oriented programming?
A. The process of hiding implementation details from users of a class. B. The process of exposing implementation details to users of a class. C. The process of defining variables and methods in a class. D. The process of creating objects from a class.
229. Which access modifiers can be used to implement encapsulation in Java?
A. Public and private B. Public and protected C. Private and protected D. Public, private, and protected
230. Which of the following is an example of encapsulation?
A. A class with all public methods and variables. B. A class with all private methods and variables. C. A class with some public and some private methods and variables D. A class with no methods or variables.
231. Which of the following best describes the relationship between encapsulation and information hiding?
A. Encapsulation and information hiding are two different terms for the same thing. B. Encapsulation is a broader concept that includes information hiding. C. Information hiding is a broader concept that includes encapsulation. D. Encapsulation and information hiding are unrelated concepts.
232. Which of the following is NOT a benefit of encapsulation?
A. Improved security of data B. Better organization of code C. Easier debugging of code D. Increased speed of execution
233. Which of the following best describes the principle of "separation of concerns" in relation to encapsulation?
A. The idea that different classes should be responsible for different tasks, and that each class should be responsible for a single concern. B. The idea that all code related to a particular feature should be located in a single class. C. The idea that classes should be designed to be easily extended and modified without breaking existing code. D. The idea that all variables and methods in a class should be accessible to other classes.
234. Which of the following statements about encapsulation in C++ is true?
A. Encapsulation is achieved through the use of access modifiers such as public, private, and protected. B. Encapsulation is not possible in C++. C. Encapsulation in C++ is achieved through the use of pointers. D. Encapsulation in C++ is achieved through the use of inheritance.
235. Which of the following best describes the relationship between encapsulation and inheritance?
A. Encapsulation and inheritance are two different terms for the same thing. B. Encapsulation is a broader concept that includes inheritance. C. Inheritance is a broader concept that includes encapsulation. D. Encapsulation and inheritance are unrelated concepts.
236. Which type of polymorphism is resolved at compile-time?
A. Runtime polymorphism B. Dynamic polymorphism C. Method overloading D. Subtyping
237. Which type of polymorphism allows objects of a subclass to be treated as objects of its superclass?
A. Compile-time polymorphism B. Dynamic polymorphism C. Subtyping D. Method overriding
238. Which of the following is NOT a form of polymorphism?
A. Method overloading B. Method overriding C. Subclassing D. Interface-based programming
239. Which type of polymorphism allows an object of a subclass to be used in place of an object of its superclass?
A. Subtyping B. Method overloading C. Method overriding D. Interface-based programming
240. Which of the following is correct?
A. Virtual functions must be members of some class, and the virtual function must be defined in the base class B. Virtual functions cannot be static members. C. Virtual Functions are accessed through object pointers. D. All of the Above
Last updated