Object Oriented Programming Quiz

A visually engaging digital illustration symbolizing Object Oriented Programming, featuring an abstract representation of classes, objects, and relationships in a colorful coding environment.

Object Oriented Programming Challenge

Welcome to the Object Oriented Programming Quiz! This quiz is designed to test your understanding of key OOP concepts, including constructors, destructors, and class behaviors. Whether you're a student or a professional looking to brush up on your skills, this quiz will challenge your knowledge.

Key features of the quiz:

  • 10 intriguing questions
  • Multiple choice format
  • Instant feedback on your answers
10 Questions2 MinutesCreated by LearningCode101
In OOP the automatic objects, constructors and destructors are called each time the objects
Enter and leave scope
Inherit parent class
Are constructed
Are destroyed
A program to find area of rectangle in Class Area in which use the Area (int a,int b) parameterized constructor to initialize length and breath, Area (2,4); initializing the data members in main Program
Output of following code ?include using namespace std; class construct { public: int a, b; // Default Constructor construct() { a = 10; b = 20; } }; int main() { // Default constructor called automatically // when the object is created construct c; cout << "a: " << c.a << endl << "b: " << c.b; return 1;
10
20
10 20
30
Comment each statment in program
 
#include
using namespace std;
class CopyCon {
int a, b;
public:
CopyCon(int x, int y) {
a = x; b = y;
cout << "\n the initialization of Constructor";
}
void Display() {
cout << "\nValues : \t" << a << "\t" << b; }
};
void main() {
CopyCon Object(30, 40);
//Copy Constructor
CopyCon Object2 = Object;
Object.Display();
Object2.Display(); }
Which among the following is not a necessary condition for constructors?
Its name must be same as that of class
It must not have any return type
It must contain a definition body
It can contains arguments
How many types of constructors are available for use in general (with respect to parameters)?
2
3
4
5
Which among the following is correct for the class defined below?class student { int marks; public: student(){} student(int x) { marks=x; } }; main() { student s1(100); student s2(); student s3=100; return 0; }
Object s3, syntax error
Number of arguments and return type
Return type and type of arguments
Return type and definition
Which of the followings is/are automatically added to every class, if we do not write our own.
Copy Constructor.
Assignment Operator
A constructor without any parameter
All of above
State whether the following statements about the constructor are True or False. i) constructors should be declared in the private section. ii) constructors are invoked automatically when the objects are created.
True,True
True,False
False True
False,False
What is the output of this program? Note:Includes all required header files class find { public: find() { cout<< "find"; } ~find() { cout<< "course"; } }; int main() { find obj; return 0; }
A. The program will print the output find.
B. The program will print the output course.
C. The program will print the output findcourse.
D. The program will report compile time error.
{"name":"Object Oriented Programming Quiz", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Welcome to the Object Oriented Programming Quiz! This quiz is designed to test your understanding of key OOP concepts, including constructors, destructors, and class behaviors. Whether you're a student or a professional looking to brush up on your skills, this quiz will challenge your knowledge.Key features of the quiz:10 intriguing questionsMultiple choice formatInstant feedback on your answers","img":"https:/images/course4.png"}
Make your own Survey
- it's free to start.