Object Oriented Programming (OOP) Solved MCQs (Set-1)
Object Oriented Programming (OOP) Solved MCQs (Set-1)
[set-1]
1. Every class has at least one constructor function, even when none is declared.
A. true
B. false
Answer: A
q M
C. by default all the struct members are public while by default class members are private.
c
D. by default all the struct members are public while by default class members are protected.
Answer: C
M
4. An abstract class can be instantiated.
A. true
B. false
Answer: B
7. Which of the following operators allow defining the member functions of a class
outside the class?
A. ::
B. ?
C. :?
D. %
Answer: A
8. Which type of class has only one unique value for all the objects of that same
class?
A. this
B. friend
C. static
D. both a and b
Answer: C
12. When class B is inherited from class A, what is the order in which the
constructers of those classes are called
A. class a first class b next
B. class b first class a next
C. class b's only as it is the child class
D. class a's only as it is the parent class
Answer: A
13. Which one of the following is not a valid reserved keyword in C++?
A. explicit
B. public
C. implicit
D. private
Answer: C
14. Variables declared in the body of a particular member function are known as
data members and can be used in all member functions of the class.
A. true
B. false
Answer: B
18. For the object for which it was called, a const member function
A. can modify both const and non-const member data.
B. can modify only const member data.
C. can modify only non-const member data.
D. can modify neither const nor non-const member data.
Answer: D
20. An expression
A. usually evaluates to a numerical value.
B. may be part of a statement.
C. always occurs outside a function.
D. option a and b
Answer: D
22. In an assignment statement, the value on the left of the equal sign is always
equal to the value on the right.
A. true
B. false
Answer: B