CS304 Quiz-3 by Vu Topper RM
CS304 Quiz-3 by Vu Topper RM
By Vu Topper RM
Question No:1 (Marks:1) Vu-Topper RM
An abstract class is useful when
no classes should be derived from it.
there are multiple paths from one derived class to another.
no objects should be instantiated from its.
you want to defer the declaration of the class.
Consider the following two lines of code written for a class Student,
Student sobj1; 2. Student sobj2(sobj1)which constructor of student class
will be called?
Default constructor of student class
Copy constructor of student class
Both default and copy constructor of student class
No constructor will be called
If we have not given any constructor for the class, compiler generates
which of the following constructors?
Implicit Default Constructor
We can call base class assignment operator in derived class user defined
assignment operator,
Using both of these options
We can access private members of the class from outside the class using
______ operator with its object pointer.
&
Which of the following is the correct syntax for passing two type
arguments to a template?
template < typename T, typename U>
Suppose Person is a user defined class. In statement “Person * pPtr”,
static type of pPtr is ____________.
Pointer
Sender of the message does not need to know the exact class of receiver
in________.
Polymorphism
Which of the following access specifier ensures that base class member
is accessible in derived class of this base class and NOT outside of this
class?
Protected
Which of the following is the correct syntax for passing two type
argument to a template?
template < type T, type U>
template < typename T, typename U>
template <type T.type U>
template Typename < T,U >
The Parameters given in tamplate definition other than those used for
mentioning tamplates type are called ________.
Default type parameters
None of the given option
Non-type parameter
Type parameter
In order to define a class template, the first line of definition must be:
Template <type nameT >
typename <template T>
Template Class <class name >
Class<template t>