- Type
- Quiz
- Course
- CS304 Object Oriented Programming
- Size
- PDF 846 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2 of 2. Download the file for all 2 pages.
Q1. Why should we write our own assignment operator when dynamic memory is involved?
Correct answer: Compiler performs shallow copy
Q2. Which of the following is the correct syntax of declaring static variable “count” of type int?
Correct answer: static int count;
Q3. Which of the following stores the address of a variable?
Correct answer: Pointer
Q4. What will be the value of variables a,b, and c after instantiating an object of the given class? class test { int a; int b; int c; public: test():b(5),c(a),a(b){ } };
Correct answer: Junk value, 5, Junk value
Q5. Why should the return type of the assignment operator be const?
Correct answer: To avoid assignment to subexpressions
Q6. Which of the following is an example of unary operator?
Correct answer: Increment Operator ( ++ )
Q7. Which of the following best describes relationship between House and Address classes?
Correct answer: Aggregation
Q8. In composition ____________ are called from composing objects to composed objects.
Correct answer: Constructors
Q9. What happens if the assignment operator returns non-const reference?
Correct answer: Assignment to subexpressions is allowed
Q10. What does return *this; do in an overloaded assignment operator?
Correct answer: Returns a reference to the current object
Related CS304 files
All CS304 files →Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.