CS304 Mcqs FinalTerm by Vu Topper RM

Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

CS304-Object

Oriented Programming
Update MCQ’S Final Term
For More Help Contact What’s app Me!!! Rizwan Manzoor
@vutopperrm Number’s = # 0322-4021365, 0316-4980094 Vu Topper RM

d
cc

For More Help Contact What’s app 03224021365


Question No:1 (Marks:1) Vu-Topper RM
If you have three classes in a C++ program A, B, and C where class A
inherits from class B, then class _____________ contains all the
characteristics of class _________________.
A. B, C
B. A, C
C. B, A
D. A, B

Question No:2 (Marks:1) Vu-Topper RM


A post-fix unary operator is implemented in C++ using non-member
function with __________ argument(s).
A. Three
B. One
C. Two
D. Zero

Question No:3 (Marks:1) Vu-Topper RM


Suppose derived class is inherited from base class. What happens when
a derived class object is created?
A. None of the given options
B. The constructor of only derived class is executed.
C. The constructor of base class is executed after the constructor of
derived class.
D. The constructor of base class is executed before the constructor
of derived class

Question No:4 (Marks:1) Vu-Topper RM


________________ represents “IS A” relationship.
A. Aggregation
B. Simple Association
C. Inheritance
D. Composition

For More Help Contact What’s app 03224021365


Question No:5 (Marks:1) Vu-Topper RM
Outside world can access only __________ members of a class using its
object.
A. Protected
B. Public
C. Private
D. No member is accessibl

Question No:6 (Marks:1) Vu-Topper RM


In C++, the subscript operator [] must be overloaded as a _______ of the
class, with one parameter of _______ type.
A. Member function, int
B. Member function, char
C. Non-member function, char
D. Non-member function, int

Question No:7 (Marks:1) Vu-Topper RM


We can call base class constructor from derived class constructor,
A. We can not call the base class constructor
B. From derived class constructor body
C. From any member function of derived class
D. From the initializer list of derived class constructor

Question No:8 (Marks:1) Vu-Topper RM


Which of the following is defined as stream extraction operator in C++?
A. *<
B. <<
C. >>
D. *>

Question No:9 (Marks:1) Vu-Topper RM


In C++, which of the following keywords works only with constructors?
A. explicit

For More Help Contact What’s app 03224021365


B. const
C. static
D. virtual

Question No:10 (Marks:1) Vu-Topper RM


Consider the code below,
class class1{
protected:
void func1();
};
class class2 : protected class1 {
};
A. protected
B. none of the given options
C. private
D. public

Question No:11 (Marks:1) Vu-Topper RM


Consider the code below:
class class1
{
private: int i;
};
class class2 : public class1
{ };
Then int member i of class1 is ______ in class2.
A. none of the given options
B. private
C. public
D. protected

Question No:12 (Marks:1) Vu-Topper RM


Consider the code below:

For More Help Contact What’s app 03224021365


class class1
{
private: int i;
};
class class2 : protected class1
{ };
Then int member i of class1 is ______ in class2.
A. none of the given options
B. protected
C. public
D. private

Question No:13 (Marks:1) Vu-Topper RM


Insertion operator is ________________ associative.
A. Left to Left
B. Right to Left
C. Right to Right
D. Left to Right

Question No:14 (Marks:1) Vu-Topper RM


In C++, which of the following operator can only be overloaded as a
member function of the class?
A. Equality Operator: ==
B. Stream Extraction Operator: >>
C. Inequality Operator: !=
D. Function Operator: ()

Question No:15 (Marks:1) Vu-Topper RM


Suppose you have following C++ statements:
int oldValue=10;
int newValue = ++ oldValue;
What will be the value of oldValue and newValue after executing above
statements?

For More Help Contact What’s app 03224021365


A. oldValue= 10 , newValue=10
B. oldValue= 10 , newValue=11
C. oldValue= 11 , newValue=11
D. oldValue= 11 , newValue=10

Question No:16 (Marks:1) Vu-Topper RM


Consider the code below,
class c1{
};
class c2 : public c1 {
};
class c3 : public c2 {
};
A. Direct base class of c2
B. Direct child class of c1
C. Direct child class of c2
D. Direct base class of c1

Question No:17 (Marks:1) Vu-Topper RM


In case of private inheritance, protected members of base class will be
_____________ in derived class?
A. hidden
B. private
C. protected
D. public

Question No:18 (Marks:1) Vu-Topper RM


A post-fix unary operator is implemented in C++ using member function
with:
A. 1 dummy char argument
B. 1 dummy int argument
C. 1 dummy float argument
D. None of the given options

For More Help Contact What’s app 03224021365


Question No:19 (Marks:1) Vu-Topper RM
Consider the code below:
class class1
{
private: void func1();
};
class class2 : protected class1
{ };
Function func1 of class1 is ______ in class2.
A. none of the given options
B. protected
C. private/hidden
D. public

Question No:20 (Marks:1) Vu-Topper RM


In resolution order of function templates, compiler searches for
_____________ in the end.
A. Generic template
B. Ordinary function
C. Partial specialization
D. Complete specialization

Question No:21 (Marks:1) Vu-Topper RM


In order to define a class template the first line of definition must be:
A. Class<template t>
B. Typename <template T>
C. Template <type nameT >
D. Template Class <class name >

Question No:22 (Marks:1) Vu-Topper RM


The parameters given in template definition other than those used for
mentioning templates types are called ____________.
A. Type Parameters

For More Help Contact What’s app 03224021365


B. Non-Type parameters
C. Default Type Parameters
D. None of the given option

Question No:23 (Marks:1) Vu-Topper RM


Which of the following is correct way to define a template class X?
A. template class X { };
B. typename <class T > class X { };
C. class< typename T > class X { };
D. template< typename T > class X { };

Question No:24 (Marks:1) Vu-Topper RM


Which of the following is known as Dereference operator in C++?
A. +
B. *
C. &
D. ::

Question No:25 (Marks:1) Vu-Topper RM


Which of the following can be passed as type arguments to templates?
A. Primitive type
B. User defined types `
C. Both Primitive type, User defined types
D. None of the given options

Question No:26 (Marks:1) Vu-Topper RM


In resolution order, highest priority is given to __________________ in
template specialization.
A. General template
B. Partial specialization
C. Complete specialization
D. None of the given options

For More Help Contact What’s app 03224021365


Question No:27 (Marks:1) Vu-Topper RM
When we specialize a function template, it is called
_____________________.
A. Function overriding
B. Function overloading
C. Function template overriding
D. Function template overloading

Question No:28 (Marks:1) Vu-Topper RM


In specialization we can:
A. Replace child class with its base class
B. Replace base class with its child class
C. Replace both child and base classes
D. interchangeablyBase class can't always be replaced by the child
class

Question No:29 (Marks:1) Vu-Topper RM


Which of the following is not type of inheritance in c++?
A. Public
B. Private
C. Protected
D. Restricted

Question No:30 (Marks:1) Vu-Topper RM


Suppose both derive and base classes have compiler generated copy
constructors then derived class copy constructor will call base class
__________,
A. Both of these options are correct
B. None of these options are correct
C. Compiler generated copy constructor
D. Compiler generated default constructor

Question No:31 (Marks:1) Vu-Topper RM

For More Help Contact What’s app 03224021365


Which of the following is/are casting operator(s) in C++?
A. static_cast
B. const_cast
C. dynamic_cast
D. All of the given Page 204
Question No:32 (Marks:1) Vu-Topper RM
We can access private members of the class from outside the class using
______ operator with its object pointer.
A. &
B. ,
C. ->
D. None of the given options

Question No:33 (Marks:1) Vu-Topper RM


Consider the code below:
class class1{ private:
void func1();};
class class2 :
public class1{ };
Function func1 of class1 is ______ in class2.
A. Public
B. Private
C. Protected
D. None of the given

Question No:34 (Marks:1) Vu-Topper RM


We can access public members of the class from outside the class using
______ operator with its object pointer.
A. ->
B. &
C. @
D. .

For More Help Contact What’s app 03224021365


Question No:35 (Marks:1) Vu-Topper RM
Compiler can automatically generate the following constructor/s for a
class,
A. Both of these
B. None of these
C. Copy constructor
D. Default constructor

Question No:36 (Marks:1) Vu-Topper RM


Target class of a _______ function call is determined at run time.
A. Virtual
B. Instance
C. Operator
D. None of given

Question No:37 (Marks:1) Vu-Topper RM


We can have ___________ type of member functions in a class.
A. Public
B. Private
C. Protected
D. All of the given

Question No:38 (Marks:1) Vu-Topper RM


Which of the following function can convert a class into an abstract
class?
A. Virtual function
B. Abstract function
C. Concrete function
D. Pure virtual function

Question No:39 (Marks:1) Vu-Topper RM


We can call base class assignment operator in derived class user defined
assignment operator,

For More Help Contact What’s app 03224021365


A. Implicitly
B. Explicitly
C. Using both of these options
D. Using none of these options

Question No:40 (Marks:1) Vu-Topper RM


A class hierarchy
shows the same relationships as an organization chart.
A. Describes “has a” relationships.
B. Describes “is a kind of” relationships.
C. Shows the same relationships as a family tree.
D. shows the same relationships as an organization chart.

Question No:41 (Marks:1) Vu-Topper RM


In private inheritance derived class pointer can be assigned to base class
pointer in,
A. Main function
B. None of the these
C. In base class member and friend functions
D. In derived class member and friend functions

Question No:42 (Marks:1) Vu-Topper RM


Polymorphism always works with ___________.
A. static objects
B. actual objects
C. Constant objects
D. pointer to class objects

Question No:43 (Marks:1) Vu-Topper RM


Two functions with same names, parameters and return type can exist in,
A. Function overriding
B. Operator overloading
C. None of these options

For More Help Contact What’s app 03224021365


D. Function overloading

Question No:44 (Marks:1) Vu-Topper RM


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?
A. Default constructor of student class
B. Copy constructor of student class
C. Both default and copy constructor of student class
D. No constructor will be called

Question No:45 (Marks:1) Vu-Topper RM


___________ binding means that target function for a call is selected at
run time.
A. Code
B. Static
C. Both
D. Dynamic

Question No:46 (Marks:1) Vu-Topper RM


In Public Inheritance the public members of base class become
__________ in derived class.
A. Public
B. Private
C. Protected
D. All of the given

Question No:47 (Marks:1) Vu-Topper RM


Suppose Person is a user defined class. In statement “Person * pPtr”,
static type of pPtr is ____________.
A. pPTR
B. Pointer
C. Person

For More Help Contact What’s app 03224021365


D. None of the given

Question No:48 (Marks:1) Vu-Topper RM


A Child class can call constructor of its parent class through,
A. Its constructor body
B. Its constructor initialization list
C. Can not call the constructor of its parent class
D. Both from its constructor initialization list or body

Question No:49 (Marks:1) Vu-Topper RM


In c++ by default access of classes is _________.
A. Public
B. Private
C. Protected
D. None of these options

Question No:50 (Marks:1) Vu-Topper RM


Consider the code below, class c1{ }; class c2 : public c1 { }; class c3 :
public c2 { }; Then c1 is,
A. Direct base class of c3
B. Direct base class of c2
C. Direct child class of c2
D. Direct child class of c3

Question No:51 (Marks:1) Vu-Topper RM


In case of dynamic memory allocation in our class we should use
A. User defined copy constructor
B. User defined default constructor
C. User defined assignment operator

Question No:52 (Marks:1) Vu-Topper RM


Function overriding is done in context of,
A. Single class

For More Help Contact What’s app 03224021365


B. Single base class
C. Single derived class
D. Derived and base classes

Question No:53 (Marks:1) Vu-Topper RM


Compiler generated copy constructor performs __________.
A. Deep copy
B. Shallow copy
C. None of these options
D. Both Shallow and Deep copy

Question No:54 (Marks:1) Vu-Topper RM


Suppose we have defined derived class copy constructor but have not
defined base class copy constructor then compiler will,
A. None of these options is correct
B. Use base class default constructor
C. Use base class assignment operator
D. Generate base class copy constructor itself

Question No:55 (Marks:1) Vu-Topper RM


Which statement will be true for concrete class?
A. It can be instantiated
B. It cannot be instantiated
C. None of the these
D. It implements an virtual concept.

Question No:56 (Marks:1) Vu-Topper RM


Sender of the message does not need to know the exact class of receiver
in________.
A. Abstraction
B. Inheritance
C. Polymorphism
D. none of the given

For More Help Contact What’s app 03224021365


Question No:57 (Marks:1) Vu-Topper RM
In case of public inheritance, protected members of base class will be
_____________ in derived class?
A. Private
B. Public
C. Protected
D. None of these given

Question No:58 (Marks:1) Vu-Topper RM


Child class can call constructor of its,
A. Direct base class
B. Indirect base class
C. Both
D. None of the these

Question No:59 (Marks:1) Vu-Topper RM


Which will be the primary task or task of generic programming?
A. All of given
B. Build concrete models of the concept
C. Implement generic algorithms based on the concept
D. Categorize the abstractions in a domain into concepts

Question No:60 (Marks:1) Vu-Topper RM


Methodologies to the development of reusable software relate to ____.
A. None of the given
B. Structure programming
C. Generic programming
D. Procedural programming

Question No:61 (Marks:1) Vu-Topper RM


Which of the following statement is true about partial specialization?
A. None of the given
B. Class template cannot have partial specialization

For More Help Contact What’s app 03224021365


C. Function templates cannot have partial specialization
D. Both class templates and function template can have partial
specialization.

Question No:62 (Marks:1) Vu-Topper RM


In C++ generic programming is done using_________
A. Packages
B. Templates
C. Procedures
D. None of the given

Question No:63 (Marks:1) Vu-Topper RM


When we want to have exactly identical operations on different data
types, ______________ are used.
A. Function Overriding
B. Function Template
C. Function Overloading
D. None of the given options

Question No:64 (Marks:1) Vu-Topper RM


Each ___________ of a template class by default becomes function
template.
A. Object
B. Date member
C. Type parameter
D. Member function

Question No:65 (Marks:1) Vu-Topper RM


Which of the following may inherit from an ordinary class?
A. Class template `
B. All of given option
C. Partial specialization
D. Complete specialization

For More Help Contact What’s app 03224021365


Question No:66 (Marks:1) Vu-Topper RM
___________ may inherit from a complete specialization.
A. All of the given
B. Ordinary class
C. Partial specialization
D. Complete specialization

Question No:67 (Marks:1) Vu-Topper RM


In resolution order, compiler searches for _________ firstly.
A. Generic template
B. Ordinary function
C. Partial specialization
D. Complete specialization

Question No:68 (Marks:1) Vu-Topper RM


In case of template specialization, if compiler cannot find required
complete specialization then it searches for some
_____________________.
A. General template
B. None of the given
C. Complete template
D. Partial specialization

Question No:69 (Marks:1) Vu-Topper RM


A class template ____________
A. Facilitates reuse of class
B. Does not support static members
C. Dose not facilitates reuse of class
D. Does not support generic methods

Question No:70 (Marks:1) Vu-Topper RM


Which of the following represents partial specialization?
A. Template < int, char >

For More Help Contact What’s app 03224021365


B. Template < class T, Type t>
C. Template<classT,classu,int>
D. Template< typename T, class W>

Question No:71 (Marks:1) Vu-Topper RM


A template provides a convenient way to make a family of
A. Functions and classes
B. Classes and exceptions
C. Programs and algorithms
D. Variables and data members

Question No:72 (Marks:1) Vu-Topper RM


We can change behavior of a template using __________.
A. Class Templates
B. Function parameters
C. Template parameters
D. none of the given options

Question No:73 (Marks:1) Vu-Topper RM


_________________ class is a single class that provides functionality to
operate on different types of data.
A. Friend
B. Ordinary
C. Template
D. None of the give options

Question No:74 (Marks:1) Vu-Topper RM


Which of the following is correct code to instantiate the object of given
template Vector class for int type?
A. Vector int obj;
B. Vector obj<>int;
C. Vector <int> obj;
D. Vector obj <int>;

For More Help Contact What’s app 03224021365


Question No:75 (Marks:1) Vu-Topper RM
Which of the following is the correct syntax for passing two type
arguments to a template?
A. Template <type T.type U>
B. Template < type T, type U>
C. Template Typename < T,U >
D. Template < typename T, typename U>

Question No:76 (Marks:1) Vu-Topper RM


Which of the following represents complete specialization?
A. Template < int, char >
B. Template < class T, float>
C. Template< class , class W>
D. Template <class T. class U.int>

Question No:77 (Marks:1) Vu-Topper RM


In statement "template <class T, class U, int I = 5>" ,the non-type
parameter is _____________.
A. int I
B. Class T
C. Class U
D. All of the given option

Question No:78 (Marks:1) Vu-Topper RM


A template argument is preceded by the keyword ________. `
A. Class
B. Type*
C. Vector
D. Template

Question No:79 (Marks:1) Vu-Topper RM


Which will be the Primary task or tasks of generic programming?
A. All of the given

For More Help Contact What’s app 03224021365


B. Build concrete models of the concept.
C. Implement generic algorithms based on the concept.
D. Categorize the abstractions in a domain into concept.

Question No:0_1 (Marks:1) Vu-Topper RM


To make a pure virtual, we need to give after () of this function.
A. =0;
B. =1;
C. Null;
D. None of the given

Question No:80 (Marks:1) Vu-Topper RM


It is illegal to make objects of one class members of another class
True
False

Question No:81 (Marks:1) Vu-Topper RM


When we create objects, then space is allocated to:
A. Data member
B. None of given
C. Access specifier
D. Member function

Question No:82 (Marks:1) Vu-Topper RM


There is only one form of copy constructor.
True
False

Question No:83 (Marks:1) Vu-Topper RM


Which of the following features of OOP is used to deal with only
relevant details?
A. Object
B. Abstraction

For More Help Contact What’s app 03224021365


C. Information hiding

Question No:84 (Marks:1) Vu-Topper RM


___________ Binding means that targets function for a call is selected at
compile time.
A. Static
B. Dynamic
C. Automatic
D. None of given

Question No:85 (Marks:1) Vu-Topper RM


In C++, we declare a function virtual by preceding the function header
with keyword “Inline
True
False

Question No:86 (Marks:1) Vu-Topper RM


Derived class can inherit from public base class as well as private and
protected base classes
True
False

Question No:87 (Marks:1) Vu-Topper RM


A function template must have a parameter
True
False

Question No:88 (Marks:1) Vu-Topper RM


Adding a derived class to a base class requires fundamental changes to
the base class.
True
False

For More Help Contact What’s app 03224021365


Question No:89 (Marks:1) Vu-Topper RM
A Class or class template can have member ___________ that are
themselves templates.
A. Objects
B. Variable
C. Function
D. None of given

Question No:90 (Marks:1) Vu-Topper RM


A class D can be derived from a class C, which is derived from a class
B, which is derived from a class A.
True
False

Question No:91 (Marks:1) Vu-Topper RM


The user must define the operation of the copy constructor.
True
False

Question No:92 (Marks:1) Vu-Topper RM


Template functions use _________ than ordinary functions.
A. Greater Memory
B. Lesser Memory
C. Equal Memory

Question No:93 (Marks:1) Vu-Topper RM


Compiler performs ________ type checking to diagnose type errors,
A. Static
B. Bound
C. Dynamic
D. Unbound

For More Help Contact What’s app 03224021365


Question No:94 (Marks:1) Vu-Topper RM
Which of the following is/are advantage[s] of generic programming?
A. Writability
B. Reusability
C. All of given
D. Maintainability

Question No:95 (Marks:1) Vu-Topper RM


Vectors contain contiguous elements stored as a[an] ___.
A. Array
B. Variable
C. Function

Question No:96 (Marks:1) Vu-Topper RM


Algorithms can only be implemented using STL containers.
True
False

Question No:97 (Marks:1) Vu-Topper RM


Inheritance is a way to organize data.
A. Pass arguments to objects of classes.
B. Improve data-hiding and encapsulation.
C. Add features to existing classes without rewriting them.

Question No:98 (Marks:1) Vu-Topper RM


We can use "this" pointer in the constructor in the body and even in the
initialization list of any class if we are careful,
True
False

Question No:99 (Marks:1) Vu-Topper RM


Default constructor is such constructor which either has no --------or if it
has some parameters these have -------- values

For More Help Contact What’s app 03224021365


A. Null, Parameter
B. None of the given
C. Parameter, default
D. Parameter, temporary

Question No:100 (Marks:1) Vu-Topper RM


Which of these are examples of error handling techniques?
A. All of the given
B. Return the illegal
C. Graceful Termination
D. Abnormal Termination

Question No:101 (Marks:1) Vu-Topper RM


Destructor can be overloaded
True
False

Question No:102 (Marks:1) Vu-Topper RM


Identify the correct way of declaring an object of user defined template
class A for char type members?
A obj;

Question No:103 (Marks:1) Vu-Topper RM


Which of the following causes run time binding?
A. Abstract class
B. Declaring object
C. None of the given

Question No:104 (Marks:1) Vu-Topper RM


The type that is used to declare a reference or pointer is called its ---
A. Static type
B. Default type
C. Abstract type

For More Help Contact What’s app 03224021365


D. Reference type

Question No:105 (Marks:1) Vu-Topper RM


By default, assignment operator (=) performs,
A. Copy data
B. Deep copy
C. Shallow copy

Question No:106 (Marks:1) Vu-Topper RM


Which of the following types of Inheritance is used to model
“Implemented in terms of” relationship?
Public
Private

Question No:107 (Marks:1) Vu-Topper RM


Consider the code below, class c1{ }; class c2 : public c1 { }; class c3 :
public c2 { }; Then c2 is,
Direct base class of c3
Direct child class of c3

Question No:108 (Marks:1) Vu-Topper RM


Static casting is,
C++ way of calling base class function from derived class
Explicit way of calling base class functions from derived class

Question No:109 (Marks:1) Vu-Topper RM


Suppose a template class "Test" has a static data member. How many
copies of this static data member will be created when template class is
instantiated by writing following line of C++ code?Test<char> x,y,z;
A. zero
B. one
C. two
D. three

For More Help Contact What’s app 03224021365


Question No:110 (Marks:1) Vu-Topper RM
When we declare a template function as friend of any class, then which
of the following specialization(s) of template function also becomes
friend of the class granting friendship?
A. Explicit
B. Partial
C. Implicit
D. All of the given options

Question No:111 (Marks:1) Vu-Topper RM


Consider the code below,
class class1{ Private:
Void func1();
};
Class class2 :
public class1{ };
Function func1 of class 1 is in class2.
Private

Question No:112 (Marks:1) Vu-Topper RM


In Protected Inheritance the public members of base class become
__________ in derived class.
Protected

Question No:113 (Marks:1) Vu-Topper RM


A parent class can call constructor of its child class through,
A. Its constructor body
B. Its constructor initialization list
C. Can not call the constructor of its child class
D. Both from its constructor initialization list or body

Question No:114 (Marks:1) Vu-Topper RM


In c++, compiler can generate which of the following operators’ code,

For More Help Contact What’s app 03224021365


A. = =
B. &
C. =
D. &&

Question No:115 (Marks:1) Vu-Topper RM


Which of the following is TRUE,
A. Both of these options
B. Base class pointer can be used as Derived class pointer
C. Derived class pointer can be used as Base class pointer
D. None of these options

Question No:116 (Marks:1) Vu-Topper RM


Public Inheritance represents,
A. “IS Special Kind of” relationship
B. None of these options
C. “IS A” relationship
D. “Has A” relationship

Question No:117 (Marks:1) Vu-Topper RM


Friend Functions of a class are _________ members of that class.
A. Private
B. Protected
C. None of the given options.
D. Public

Question No:118 (Marks:1) Vu-Topper RM


A class with no pure virtual function is a ________ class.
Concrete

Question No:119 (Marks:1) Vu-Topper RM


If the user does not specify the type of inheritance, then the default type
of inheritance is ____________.

For More Help Contact What’s app 03224021365


Private inheritance

Question No:120 (Marks:1) Vu-Topper RM


Which of the following is NOT casting operator in C++ standard?
A. static_cast
B. var_cast
C. reinterpret_cast
D. dynamic_cast

Question No:121 (Marks:1) Vu-Topper RM


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?
A. All of the given
B. public
C. protected
D. private

Question No:122 (Marks:1) Vu-Topper RM


In Private Inheritance the public members of base class become
__________ in derived class.
Private

Question No:123 (Marks:1) Vu-Topper RM


If we have not given any constructor for the class, compiler generates
which of the following constructors?
A. Explicit Default Constructor
B. Implicit Parameterized Constructor
C. Implicit Default Constructor
D. Explicit Parameterized Constructor

For More Help Contact What’s app 03224021365


Question No:124 (Marks:1) Vu-Topper RM
It is good practice to avoid ____ objects to treat polymorphically.
A. Array
B. Public
C. Private
D. Protected

Question No:125 (Marks:1) Vu-Topper RM


Consider the code below.
Class class1{ Protected: Int I; }; Class class2: private calls 1{ };
A. Public
B. Private
C. Protected
D. None of these

Question No:126 (Marks:1) Vu-Topper RM


Template<> class Vector{ void** p; //.... void*& operator[] ((int i); };
A. This specialization can then be used double type pointers.
B. This specialization should be used for Vectors of all type int types.
C. This specialization can then be used as the all-type implementation
for one type classes.
D. This specialization can then be used as the common
implementation for all Vectors of pointers.

Question No:127 (Marks:1) Vu-Topper RM


The Specialization pattern after the name says that this specialization is
to be used for every___.
A. Data types
B. Meta types
C. Virtual types
D. Pointer’s type

For More Help Contact What’s app 03224021365


Question No:128 (Marks:1) Vu-Topper RM
C++ dynamic binding and polymorphism will be achieved when
member function will be __.
A. Public
B. Private
C. Virtual
D. None of these

Question No:129 (Marks:1) Vu-Topper RM


Consider the code below, class class1{ protected: void func1(); }; class
class2 : public class1 { }; Function func1 of class1 is ____ in class2,
A. Public
B. Private
C. Protected
D. None of the given options

Question No:130 (Marks:1) Vu-Topper RM


Consider the code below, class class1{ protected: int i; }; class class2 :
protected class1 { }; Then int member i of class1 is ______ in class2,
A. Public
B. Private
C. Protected
D. None of the given options

Question No:131 (Marks:1) Vu-Topper RM


Consider the code below , class class1{ private: void func1(); }; class
class2 : private class1 { }; Function func1 of class1 is ____ in class2,
A. Public
B. Private
C. Protected
D. None of the given options

For More Help Contact What’s app 03224021365


Question No:132 (Marks:1) Vu-Topper RM
Consider the following statements: 1) int iArray[5]; 2) int *pArr =
iArray;
A. None of given options
B. Error in first statement
C. Error in second statement
D. These statements will compile successfully

Question No:133 (Marks:1) Vu-Topper RM


If there is a pointer, p, to objects of a base class, and it contains the
address of an object of a derived class, and both classes contain a virtual
member function, ding(), then the statement p->ding(); will cause the
version of ding() in the ___ class to be executed.
A. Base
B. Virtual
C. Derived
D. Implemented

Question No:134 (Marks:1) Vu-Topper RM


A class template may inherit from another class template.
True
False

Question No:135 (Marks:1) Vu-Topper RM


An abstract class is useful when
A. No classes should be derived from it.
B. No objects should be instantiated from its.
C. There are multiple paths from one derived class to another.

Question No:136 (Marks:1) Vu-Topper RM


Select correct line of code for composition relationship between
“Keyboard” class and “Keys” class
A. Class keyboard : private keys

For More Help Contact What’s app 03224021365


B. Class keyboard { Keys type;};
C. Class keys{ KeyBoard type; };
D. Class keys: private KeyBoard

Question No:137 (Marks:1) Vu-Topper RM


Select correct line of code for inheritance relationship between “Keys”
class and “SpecialKeys” class. “Keys” is parent class while
“SpecialKeys” is child class
A. Class Keys: public SpecialKeys
B. Class SpecialKeys:: public Keys
C. Class Keys:: public SpecialKeys
D. Class SpecialKeys: public Keys

Question No:138 (Marks:1) Vu-Topper RM


User can make virtual table explicitly.
True
False

Question No:139 (Marks:1) Vu-Topper RM


A function call is resolved at run-time in___________
A. Virtual member function
B. Both non-virtual member
C. Virtual member function
D. Non-virtual member function

Question No:140 (Marks:1) Vu-Topper RM


Consider the code below, class class1{ public: int i; }; class class2 :
public class1 { }; Then int member i of class1 is ____ in class2,
A. Public
B. Private
C. Protected
D. None of the given options

For More Help Contact What’s app 03224021365


Question No:141 (Marks:1) Vu-Topper RM
A class can inherit from more then one class is called.
A. Single inheritance
B. Simple inheritance
C. Double inheritance
D. Multiple inheritances

Question No:142 (Marks:1) Vu-Topper RM


The default inheritance mode is,
A. Public inheritance
B. Private inheritance
C. Protected inheritance
D. None of these options

Visit My YouTube Channel


For Subjective and More
Important Files
Channel Name = #VuTopperRM

For More Help Contact What’s app 03224021365

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy