A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

1. Passing object to a function _______________
a. Can be done only in one way
b. Can be done in more than one ways
c. Is not possible
d. Is not possible in OOP
View Answer Report Discuss Too Difficult!
Answer: (b).Can be done in more than one ways

2. The object ________________
a. Can be passed by reference
b. Can be passed by value
c. Can be passed by reference or value
d. Can be passed with reference
View Answer Report Discuss Too Difficult!
Answer: (c).Can be passed by reference or value

3. Which symbol should be used to pass the object by reference in C++?
a. &
b. @
c. $
d. $ or &
View Answer Report Discuss Too Difficult!
Answer: (a).&

4. If object is passed by value, ________________
a. Copy constructor is used to copy the values into another object in the function
b. Copy constructor is used to copy the values into temporary object
c. Reference to the object is used to access the values of the object
d. Reference to the object is used to created new object in its place
View Answer Report Discuss Too Difficult!
Answer: (a).Copy constructor is used to copy the values into another object in the function

5. Pass by reference of an object to a function _______________
a. Affects the object in called function only
b. Affects the object in prototype only
c. Affects the object in caller function
d. Affects the object only if mentioned with & symbol with every call
View Answer Report Discuss Too Difficult!
Answer: (c).Affects the object in caller function

6. Copy constructor definition requires __________________
a. Object to be passed by value
b. Object not to be passed to it
c. Object to be passed by reference
d. Object to be passed with each data member value
View Answer Report Discuss Too Difficult!
Answer: (c).Object to be passed by reference

7. What is the type of object that should be specified in argument list?
a. Function name
b. Object name itself
c. Caller function name
d. Class name of object
View Answer Report Discuss Too Difficult!
Answer: (d).Class name of object

8. If an object is passed by value, _________________
a. Temporary object is used in the function
b. Local object in the function is used
c. Only the data member values are used
d. The values are accessible from the original object
View Answer Report Discuss Too Difficult!
Answer: (b).Local object in the function is used

9. Can data members be passed to a function using the object?
a. Yes, it can be passed only inside class functions
b. Yes, only if the data members are public and are being passed to a function outside the class
c. No, can’t be passed outside the class
d. No, can’t be done
View Answer Report Discuss Too Difficult!
Answer: (b).Yes, only if the data members are public and are being passed to a function outside the class

10. What exactly is passed when an object is passed by reference?
a. The original object name
b. The original object class name
c. The exact address of the object in memory
d. The exact address of data members
View Answer Report Discuss Too Difficult!
Answer: (c).The exact address of the object in memory

Page 1 of 8