This sets of multiple choice questions [MCQs] contains questions object oriented programming MCQ with answers for SPPU university exams and other exams in part 1...
SET 1 of Object Oriented Programming
Q1. The programming language must have property of _______ if it is a object oriented programming
A . #include files
B. functions that return only a single value
C. inheritance
D. All of the above
Answer:- C. inheritance
Q2. A C++ program has a programmer defined void function.When there is ending brace of the function like this } , the compiler will return to the statement ___
A. immediately above the statement that called the function
B. imm.ediately below the statement that called the function
C. that called the function
D. to the function itself
Answer:- B. immediately below the statement that called the function
Q3. The ___ pointer cannot be used with pointers in C++.
A .->
B. *
C. &
D. >>
Answer:- D. >>
Q4. The meaning of encapsulation is as follows:
A. To inherit properties of base class
B. To gridlock of data and code together
C. To reduce code length
D. To define global variable
Answer:- B. To gridlock of data and code together
Q5. An object compromises of
A. behaviour
B. state
C. none of both
D. both of above
Answer:- D. both of above
Q6. Identify the incorrect statement
A . A reference value once defined can be reassigned
B. reference is the alternate name of the object
C. A reference value once defined cannot be reassigned
D. none of the mentioned
Answer:- C. A reference value once defined cannot be reassigned
Q7 Which of the following is the only technical difference between structures and classes in C++?
A. Member function and data are by default protected in structures but private in classes.
B. Member function and data are by default public in structures but private in classes.
C. Member function and data are by default public in structures but protected in classes
D. Member function and data are by default private in structures but public in classes.
Answer:- D Member function and data are by default private in structures but public in classes.
Q8 Class acquire space in memory..
A. True
B. False
Answer:- B. False
Q9. If the type specifier of parameters of a function is followed by an ampersand (&), that function call is
A. pass by value
B. pass by reference
Answer:- B pass by reference
Q10. Inline functions have the property of
A. Speeding up Excecution
B. Slowing down execution
C. Increasing code size
D. first and third option
Answer:- B. Slowing down execution
SET 2 of Object Oriented Programming
Q11 If a program is divided into different functions , then
A. it makes the program easier to conceptualize
B. it may reduce the size of the program
C. Both A & B
D. none of above
Answer:- C. Both A & B
Q12 An argument which cannot be passed to function is
A. A constant
B. A structure
C. A header file.
D. A variable
Answer:- C. A header file.
Q13. The feature of OOP that allows you to use the same function name for separate functions that have different argument lists is called
A. Overriding
B. overloading
C. constructing
D. Destructing
Answer:- B. overloading
Q14. The scope resolution operator defines the scope of
A. variable
B. function
C. data member
D. first and second
Answer:- D. first and second
Q15 The * is called as
A. member dereferencing operator
B. member referencing operator
C. scope resolution operator
D. None of above
Answer:- A. member dereferencing operator
Q16. Which is used to tell the computer that where a pointer is pointing to?
A. dereference
B. reference
C. heap operations
D. binary operations
Answer:- A. dereference
Q17. Which is used to do the dereferencing?
A. pointer without asterix
B. value without asterix
C. pointer with asterix
D. value with asterix
Answer:- C. pointer with asterix
Q18 Pick out the correct option.
A. References automatically dereference without needing an extra character
B. References automatically dereference with an extra character
C. Reference will not dereference
D. Reference automatically dereference with extra space and character
Answer:- A. References automatically dereference without needing an extra character
Q19 What does the dereference operator will return?
A. value equivalent to the value at the pointer address
B. value equivalent to the value at the pointer address
C. it will return nothing
D. it will return boolean values
Answer:- B. value equivalent to the value at the pointer address
Q20. What is the return type of the conversion operator?
A. void
B. int
C. float
D. no return type
Answer:- D. no return type
Q21 How many parameters does a conversion operator may take?
A. 0
B. 1
C. 2
D. many
Answer:- A. 0