0% found this document useful (0 votes)
3 views

Constructors

This document is a worksheet for Class X students on the topic of constructors in computer applications. It contains multiple-choice questions that cover various aspects of constructors, such as their definition, types, invocation, and characteristics. The questions aim to assess the understanding of constructors in object-oriented programming.

Uploaded by

sumanpratham5555
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Constructors

This document is a worksheet for Class X students on the topic of constructors in computer applications. It contains multiple-choice questions that cover various aspects of constructors, such as their definition, types, invocation, and characteristics. The questions aim to assess the understanding of constructors in object-oriented programming.

Uploaded by

sumanpratham5555
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

COMPUTER APPLICATIONS

CONSTRUCTOR WORKSHEET 1
CLASS X
1. A constructor is used to ………. the data members
a) Inform b) interchange c) initialize d) introduce

2. Types of constructors are


a) default b) parameterized c) both 1 & 2 d) none of the above

3. Constructor is ……… called while creating an object.


a) automatically b) forcefully c)vaguely d)rarely

4. A Constructor is defined with the name


a) Same as class name b) Never as the class name
c) Any name d) None of the above

5. Which unit of the class gets called at the time of object creation.
a) Block b) constructor c) class d) program

6. …………….. is creating the Instance of the class in the following snippet:


myprog obj = new myprog( );
a) new b) myprog() c) obj d) none of the above

7. Multiple constructors with same name and different parameters defined in


a class are called:
a) variety constructors c)multi constructors
c) overflowing constructors d) overloaded constructors

8. Which of the following is not applicable for a constructor function?


a) It has the same name as the class.
b) It has no return-type.
c) It is usually used for initialization.
d) It can be invoked using an object like any other member function.

9. Which among the following is called first, automatically, whenever an object is


created?
a) Class b) Constructor c)new d)object

10. Which constructor is supplied by the compiler if there is no constructor


defined in a class?
a) Parameterized constructor c) Default constructor
c) Copy constructor d)None of the above

11. What is the return type of a constructor?


a) void b) int c) No return type d) None of the above
12. When is a constructor invoked?
a) When object of class is created. b) When class is created.
c) When data members are created. d) It has to be called explicitly.

13. Which statement is false about constructor?


a) constructors can accept parameters.
b) constructors can return value.
c) constructors are invoked when objects are created.
d) constructors can be overloaded.

14. In constructor overloading, ______________________


a) All constructors must have the same name as that of the class
b) All constructors must have the same number of arguments
c) All constructors must have the same variables inside them.
d) All constructors must have no arguments.

15. Pick the correct answer:


a) A constructor has exactly the same name as its defining class.
b) A constructor method does not have a return type.
c) A constructor can be invoked only via the new operator.
d) All of the above.

16. A default constructor has_________________


a) No parameters b) Two parameters c) One parameter d) Multiple
parameter

17. A constructor is used when an object is______________


a) Created b) assigned a value c) destroyed d) abstracted

18. What is a constructor?


a) It is a block of code that initializes a newly created object.
b) It has the same name as class name.
c) It has no return type.
d) All of the above.

19. The name of a constructor …


a) Can be any legal identifier
b) Must include the name of the package
c) Will always be the word new
d) Will always be the same as the name of the class

20. Assertion (A) : A Constructor is a special member function and has the same
name as the class itself.
Reason (R) : A constructor and class are the same things.
a) Both A and R are true and R is the correct explanation of A.
b) Both A and R are true and R is not the correct explanation of A.
c) A is true but R is false.
d) A is false but R is true.

21 . Assertion (A) : A default constructor has no parameters.


Reason (R) : A parameterized constructor has parameters.
a) Both A and R are true and R is the correct explanation of A.
b) Both A and R are true and R is not the correct explanation of A.
c) A is true but R is false.
d) A is false but R is true.

You might also like