New ! Computer Science MCQ Practise Tests



11th Standard English Medium Computer Science Subject Classes and objects Book Back 1 Mark Questions with Solution Part - II

11th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Science

Time : 01:00:00 Hrs
Total Marks : 5

    1 Marks

    5 x 1 = 5
  1. class x
    {
    int y;
    public:
    x(int z){y=z;}
    } x1[4];
    int main()
    { x x2(10);
    return 0;}
    How many objects are created for the above program?

    (a)

    10

    (b)

    14

    (c)

    5

    (d)

    2

  2. 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.

    (a)

    True, True

    (b)

    True, False

    (c)

    False, True

    (d)

    False, False

  3. Which of the following constructor is executed for the following prototype?
    add display (add &): - // add is a class name

    (a)

    Default constructor

    (b)

    Parameterized constructor

    (c)

    Copy constructor

    (d)

    Non Parameterized constructor

  4. What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero-argument constructor?

    (a)

    Compile-time error

    (b)

    Domain error

    (c)

    Runtime error

    (d)

    Runtime exception

  5. Which of the following create a temporary instance?

    (a)

    Implicit call to the constructor

    (b)

    Explicit call to constructor

    (c)

    Implicit call to the destructor

    (d)

    Explicit call to the destructor

*****************************************

Reviews & Comments about 11th Standard English Medium Computer Science Subject Classes and objects Book Back 1 Mark Questions with Solution Part - II updated Book back Questions

Write your Comment