adplus-dvertising

Welcome to the Objects and Classes in OOPs MCQs Page

Dive deep into the fascinating world of Objects and Classes in OOPs with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Objects and Classes in OOPs, a crucial aspect of Object Oriented Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Objects and Classes in OOPs, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within Object Oriented Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Objects and Classes in OOPs. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Object Oriented Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Objects and Classes in OOPs. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Objects and Classes in OOPs MCQs | Page 1 of 15

Explore more Topics under Object Oriented Programming

Q1.
In how many ways can an object be passed to a function?

a.

1

b.

2

c.

3

d.

4

Discuss
Answer: (c).3
Discuss
Answer: (a).A new copy of object is created implicitly
Q3.
Pass by address passes the address of object _________ and pass by reference passes the address of the object _________
Discuss
Answer: (c).Explicitly, Implicitly
Discuss
Answer: (a).Are reflected to the main object of caller function too
Q5.
Constructor function is not called when an object is passed to a function, will its destructor be called when its copy is destroyed?
Discuss
Answer: (b).Yes, must be called
Q6.
When an object is returned by a function, a _______________ is automatically created to hold the return value.
Discuss
Answer: (a).Temporary object
Discuss
Answer: (c).No, unexpected side effects may occur
Discuss
Answer: (d).Overloading assignment operator and defining copy constructor
Q9.
How many objects can be returned at once?
Discuss
Answer: (a).Only 1
Q10.
What will be the output of the following code?
Class A
{ 
 int i; 
 public : A(int n)
 { 
  i=n; cout<<”inside constructor ”;
 } 
 ~A()
 {
  cout<<”destroying  ”<<i;
 }
 void seti(int n)
 {
  i=n;
 }
 int geti()
 {
  return I;
 }
};
void t(A ob)
{ 
 cout<<”something ”;
}
int main()
{
 A a(1);
 t(a);
 cout<<”this is i in main ”;
 cout<<a.geti();
}
Discuss
Answer: (a).inside constructor something destroying 2this is i in main destroying 1

Suggested Topics

Are you eager to expand your knowledge beyond Object Oriented Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!