Practice Test: Question Set - 02
1. Which of the following is not recommended in a header file?
- (A) Type
definitions (typedefs)
- (B) Class
definitions
- (C) Function
definitions
- (D) Template
definitions
2. Which of the STL containers store the elements contiguously (in adjacent memory locations)?
- (A) std::vector
- (B) std::list
- (C) std::map
- (D) std::set
3. What does STL stand for?
- (A) Simple
Template Library
- (B) Standard
Template Library
- (C) Static Type
Library
- (D) Single Type-based
Library
4. If the class name is X, what is the type of its “this” pointer (in a non-static, non-const member function)?
- (A) const X*
const
- (B) X* const
- (C) X*
- (D) X&
5. Which one of the following is not a valid reserved keyword in C++
- (A) Explicit
- (B) Public
- (C) Implicit
- (D) Private
6. Each pass through a loop is called a/an
- (A) Enumeration
- (B) Iteration
- (C) Culmination
- (D) Pass
through
7. Which of the following is true about const member functions?
- (A) Const
members can be invoked on both const as well as nonconst objects
- (B) Const
members can be invoked only on const objects and not on nonconst objects
- (C) Non-const
members can be invoked on const objects as well as nonconst objects
- (D) None
of the above
8. Which of the following relationship is known as inheritance relationship?
- (A) ‘has-a’ relationship
- (B) ‘is-a’ relationship
- (C) Association
relationship
- (D) None of the
above
9. If class A is friend of class B and if class B is friend of class C, which of the following is true?
- (A) Class C is
friend of class A
- (B) Class A is
friend of class C
- (C) Class A and
Class C do not have any friend relationship
- (D) None of the
above
10. A direct access file is:
- (A) A file in
which records are arranged in a way they are inserted in a file
- (B) A file in
which records are arranged in a particular order
- (C) Files which
are stored on a direct access storage medium
- (D) None of the
above
Next Tests: