OOPS Formative Test-I
  • 1. Pick the odd one out
A) boolean type
B) array type
C) integer type
D) character type
E) None of the above
  • 2. Which data type is used to represent the absence of parameters?
A) char
B) string
C) int
D) void
E) float
  • 3. What does ‘\a’ escape code represent?
A) alert
B) alone
C) form feed
D) nextline
E) tabspace
  • 4. Which type is best suited to represent the logical values?
A) integer
B) character
C) float
D) All of the above
E) boolean
  • 5. Which of the following accesses the seventh element stored in array?
A) array[6]
B) array(7)
C) array(5)
D) array[7]
E) array(6)
  • 6. What does a class in C++ holds?
A) both data & functions
B) only data
C) macros
D) only functions
E) All of the above
  • 7. Which is used to define the member of a class externally?
A) ?:
B) ::
C) #
D) :
E) @
  • 8. Which keyword is used to define the user defined data types?
A) typedef
B) def
C) union
D) type
E) structure
  • 9. Which of these following members are not accessed by using direct member access operator?
A) private
B) both private & protected
C) public
D) protected
E) All of the above
  • 10. Which special character is used to mark the end of class?
A)
B) //
C) ;
D) .
E) ::
  • 11. What is the syntax of user-defined data types?
A) def NameByUser ExistingDataType
B) None of the above
C) typedef ExistingDataType NameByUser
D) typedef NameByUser ExistingDataType
  • 12. What is the scope of typedef defined data types?
A) None of the above
B) outside the program
C) inside that block only
D) whole program
  • 13. What is the replacement of macros in C++
A) None of the above
B) inline functions
C) friend functions
D) conditional operator
  • 14. Which of the below are object oriented features
A) encapsulation
B) inheritance
C) data binding
D) polymorphism
E) All of the above
  • 15. A constructor that accepts __________ parameters is called the default constructor.
A) zero
B) two
C) three
D) four
E) one
  • 16. Destructor has the same name as the constructor and it is preceded by ______ .
A) !
B) %
C) @
D) ~
E) #
  • 17. __________ used to make a copy of one class object from another class object of the same class type.
A) default constructor
B) copy constructor
C) constructor
D) inline function
E) friend function
  • 18. How many default constructors per class are possible?
A) One
B) Three
C) Multiple
D) All the above
E) Two
  • 19. Which of the following type of data member can be shared by all instances of its class?
A) private
B) friend
C) static
D) public
E) protected
  • 20. Which of the following gets called when an object goes out of scope?
A) virtual function
B) main
C) None
D) destructor
E) constructor
Students who took this test also took :

Created with That Quiz — the site for test creation and grading in math and other subjects.