OOP - Classes & Objects MCQs With Answers For Exams Part 3
1 Which of the following concepts of OOPS means exposing only necessary
information to client?
A Encapsulation
B Abstraction
C Data hiding
D Data binding
Answer C
2 Which of the following keywords is used to control access to a class member?
A Default
B Break
C Protected
D Asm
Answer C
3 Utility functions are also called as .......
A Virtual function
B Friend function
C Helper function
D None of above
Answer C
4 ......... is a member function with the same name as the class.
A Friend function
B Constructor
C Destructor
D None of above
Answer B
5 Which is not the feature of constructor?
A It cannot be inherited.
B It should be declared in Private.
C It do not have return type
D All of above
Answer B
6 Which is not type of constructor?
A Default
B Copy
C Parameterized
D None of above
Answer D
7 Objects are destroyed in the reverse order of its creation.
A True
B False
Answer A
8 .... constructor is used for copying the object of same class type.
A Copy
B Default
C Parameterized
D None of above
Answer A
9 The function inside a class is called as .......
A Class Function
B Member Function
C Method
D All of above
Answer B
10 Which operator is used to define member function of a class outside the class?
A !
B :
C ::
D .
Answer C
11 How many objects can be created by a class?
A 1
B 2
C 3
D As Many as required
Answer D
12 Default return type of C++ main( ) is .....
A float
B void
C Int
D Pointer
Answer C
13 Enumerated data type is ........
A User-defined data type
B In-built data type
C Derived data type
D None of above
Answer A
14 Attributes of a class are called as ........
A Member functions
B Data members
C Objects
D All of above
Answer B
15 Class acquire space in memory.
A True
B False
Answer B
16 In object-oriented programming ........ is more important.
A Function
B Procedure
C Data
D All of above
Answer C
17 Object-oriented programming follows Top-down approach.
A True
B False
Answer B
18 The following operators can not be overloaded
A Unary operator
B Binary operator
C Ternary operator
D None of the above
Answer C
19 C++ does not supports the following
A Multilevel inheritance
B Hierarchical inheritance
C Hybrid inheritance
D None of the above
Answer D
20 Which of the following is not the keyword in C++?
A Volatile
B Friend
C Extends
D This
Answer C
21 Which data type can be used to hold a wide character in C++?
A unsigned char;
B Int
C wchar_t
D None of the above
Answer C
22 Which type is best suited to represent the logical values?
A integer
B boolean
C character
D all of the mentioned
Answer B
23 The following is the C++ style comment
A //
B /*..*/
C –
D None of above
Answer A
24 Which of the following statements is false?
A Every C++ program must have a main().
B In C++, white spaces and carriage returns are ignored by the compiler.
C C++ statements terminate with semicolon.
D Main() terminates with semicolon.
Answer D
25 Which of the following statements regarding comments is false?
A /*..*/
B Comment beginning with // extends to the end of the line
C Comments may be nested
D Comments are used to describe a program
Answer C
26 The result of the following statement is
int y = 7;
int ans = ++y;
cout<<”ans=”<<ans;
cout<<”y”<<y;
A ans=7, y=7
B ans=8,y=7
C ans=8,y=8;
D None
Answer C
27 Inline functions are
A Declared in the class defined outside the class
B Defined outside the class using keyword inline
C Defined inside the class using keyword inline
D None of the above
Answer B
28 Functions can returns
A Arrays
B References
C Objects
D All of above
Answer D
29 Which of the following control expressions are valid for an if statement?
A an integer expression
B a Boolean expression
C either A or B
D Neither A nor B
Answer C
30 State true of false.
i) We cannot make the function inline by defining a function outside the class.
ii) A member function can be called by using its name inside another member
function of the same class, this is known as nesting of member function.
A True, True
B True, False
C False, True
D False, False
Answer C
31 What will be the values of x, m and n after execution of the following statements?
Int x, m, n;
m=10;
n=15;
x= ++m + n++;
A x=25, m=10, n=15
B x=27, m=10, n=15
C x=26, m=11, n=16
D x=27, m=11, n=16
Answer C