Home > Object Oriented Programming > Quizzes > Object Oriented Programming Practice Test: Constructors and Destructors
Object Oriented Programming Practice Test: Constructors and Destructors
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 57% Most missed: “How the constructors and destructors can be differentiated?”
Quiz on constructors and its types, copy constructor, overloading constructors, destructors, execution of constructor or destructor. In object-oriented programming (OOP), constructors and destructors are special member functions of a class that handle the initialization and cleanup of objects, respectively. Constructors are used to initialize objects of a class. They are called automatically when an object is created, and they can be used to set the initial values of the object's member variables. Destructors are used to clean up objects when they are destroyed. They are called... Show more
Object Oriented Programming Practice Test: Constructors and Destructors
Time left 00:00
25 Questions

1. If programmer have defined parameterized constructor only, then __________________
2. Can constructors be overloaded in derived class?
3. Destructors can be ________
4. In which access should a constructor be defined, so that object of the class can be created in any function?
5. For explicit call _________________
6. Which among the following is called first, automatically, whenever an object is created?
7. When is the constructor called for an object?
8. Destructors doesn’t accept parameters.
9. Which among the following is possible way to overload constructor?
10. Which among the following is false for a constructor?
11. The destructor can be called before the constructor if required.
12. If constructors of a class are defined in private access, then __________
13. Which among the following best describes constructor overloading?
14. What are we only create an object but don’t call any constructor for it in java?
15. Which among the following describes a destructor?
16. Which among the following best describes destructor?
17. How many types of constructors are available, in general, in any language?
18. If class C inherits class B. And B has inherited class A. Then while creating the object of class C, what will be the sequence of constructors getting called?
19. Copy constructor will be called whenever the compiler __________
20. Which among the following is true?
21. Within a class, only one static constructor can be created.
22. Which among the following is not a necessary condition for constructors?
23. If a programmer defines a class and defines a default value parameterized constructor inside it.
He has not defined any default constructor. And then he try to create the object without passing arguments, which among the following will be correct?
24. Which among the following is true for static constructor?
25. How many types of constructors are available for use in general (with respect to parameters)?