Yathirajsolutions.com
HOME      EDUCATION      NEWS      SHOPING 

2nd PUC computer science
Chapter-9: Constructors and Destructors MCQs-2024

Q1.constructor should be declared in
    a.public section
    b.private section
    c.protected section
    d.all of the above
    view Answer
    ans: a.public section

Q2.special member function that is used in classes to initialize the objects of a class automatically
    a.Destructors
    b.friend function
    c.constructor
    d.inline function
    view Answer
    ans:c.constructor

Q3.It is not possible to initialize different objects with different initial values using
    a.Parameterized constructor
    b.Copy constructor
    c.Default constructor
    d.None of these
    view Answer
    ans:c.Default constructor

Q4.A constructor that takes one or more arguments is called
    a.Default constructor
    b.Parameterized constructor
    c.zero constructor
    d.all of the above
    view Answer
    ans:b.Parameterized constructor

Q5.A constructor which does not accept any arguments is called
    a.Parameterized constructor
    b.Default constructor
    c.copy constructor
    d.All of the above
    view Answer
    ans:b.Default constructor

Q6.declaration of an object is followed by assignment operator, constructor name and argument list enclosed in parenthesis.
    a.Explicit call
    b. Implicit call
    c. Initialization at the time of declaration with = operator
    d.None of these
    view Answer
    ans:a.Explicit call

Q7.the declaration of the object is followed by argument list enclosed in parentheses.
    a.Implicit call
    b. Explicit call
    c. Initialization at the time of declaration with = operator
    d.None of these
    view Answer
    ans:a.Implicit call

Q8.This method is used for the constructor with exactly one argument. In this method declaration is followed by assignment operator and value to be initialized.
    a.Explicit call
    b.Implicit call
    c. Initialization at the time of declaration with = operator
    d.friend function call
    view Answer
    ans:c. Initialization at the time of declaration with = operator

Q9. Copy constructors are used in
    a. To initialize an object with the values of already existing objects.
    b. When objects must be returned as function values
    c. To state objects as by value parameters of a function.
    d.all of the above
    view Answer
    ans: d.all of the above

Q10.Member function that destroy an object automatically.
    a.Constructor
    b.Destructor
    c.friend
    d.inline
    view Answer
    ans:b.Destructor

Q11.The symbol used with destructor is
    a.&
    b. *
    c. ~
    d. #
    view Answer
    ans:c. ~

Q12.In general how many destructor are present in a class
    a. one
    b.two
    c.unlimited
    d.None of the above
    view Answer
    ans:a. one

Q13.In which type of constructor are all the obejects created initialized to the same set of values ?
    a. Parameterized constructor
    b.Default constructor
    c. Copy constructor
    d.None of the above
    view Answer
    ans: b.Default constructor

Q14._____________does not return any value
    a.default Constructor
    b.copy Constructor
    c.destructor
    d.all of the above
    view Answer
    ans:d.all of the above

Q15. Constructor name is
    a.same as class name
    b.same as object name
    c.same as inline function name
    d.None of the above
    view Answer
    a.same as class name

Q16.There is no return type for
    a.inline function
    b.friend function
    c.Constructor
    d.None of these
    view Answer
    ans:c.Constructor



Author: yathirajsolutions.com designed by Sathisha M

yathirajsolutions.com

Contact Us

Fill up the form below to send us a message.