UNIT 2 MCQ
Id 1
Question Polymorphism is supported by the c++ by using following ways
A function overloading
B operator overloading
C virtual functions
D all of the above
Answer D
Marks 1
Unit II
Id 2
Question Compile time polymorphism is supported by
A function overloading
B virtual function
C operator overloading
D both a&c
Answer D
Marks 1
Unit II
Id 3
Question Run time polymorphism is supported by
A function overloading
B operator overloading
C virtual function
D both a and b
Answer C
Marks 1
Unit II
Id 4
Question Selecting the appropriate overloaded function by the compiler is known as
A late binding
B early binding
C both a and b
D none of the above
Answer B
Marks 1
Unit II
Id 5
Question object to function binding is done at compile time then is it known as
A early binding
B compile time binding
C none of the above
D both a and b
Answer D
Marks 1
Unit II
Id 6
Question Run time polymorphism is done by using
A function overloading
B operator overloading
C virtual function
D none of the above
Answer C
Marks 1
Unit II
Id 7
Question Operator overloading is ---.
A run time polymorphism
B compile time polymorphism
C none of the above
D both a and b
Answer B
Marks 1
Unit II
Id 8
Question Which of the following operator cannot be overloaded
A scope resolution operator(::)
B Size of operator (sizeof[])
C Conditional operator(?:)
D All of the above
Answer D
Marks 1
Unit II
Id 9
Question Which of the operator cannot be overloaded
A >=
B &
C <=
D ::
Answer D
Marks 1
Unit II
Id 10
Question While performing operator overloading which function/keyword we have to use
A Function
B Operator
C Op
D none of the above
Answer B
Marks 1
Unit II
Id 11
Question Which of the statement is not true about operator overloading
A we can overload only existing operator
B basic meaning cannot be changed
C binary operator should have return type
D All of the above
Answer D
Marks 1
Unit II
Id 12
Question Pick up the correct statement related with operator overloading
A we can overload a class access operator
B we can change the meaning of basic operator
C binary operator should have a return type
D both a and b
Answer C
Marks 1
Unit II
Id 13
Question We are overloading a unary operator without friend function how many argument we have
to pass
A 1
B 2
C 0
D none of the above
Answer C
Marks 1
Unit II
Id 14
Question Suppose we are overloading a binary operator with friend function, how many parameter
of argument we have to pass
A 1
B 2
C 3
D none of ths above
Answer B
Marks 1
Unit II
Id 15
Question we are overloading a binary operator without friend function how many argument we
have to pass
A 1
B 2
C 0
D none of the abve
Answer A
Marks 1
Unit II
Id 16
Question What is polymorphism
A it is ability to take many forms
B it is instance of class
C one class acquire the properties of another class
D All of the above
Answer A
Marks 1
Unit II
Id 17
Question What is true about the operator overloading
A with friend function we need to pass two arguments for binary operator
B with friend function we need to pass one arguments for unary operator
C both a and b
D none of the above
Answer C
Marks 1
Unit II
Id 18
Question ______allows you to give special meaning to some operator when there are operands
associated with it.
A function overloading
B virtual function
C operator overloading
D none of the above
Answer C
Marks 1
Unit II
Id 19
Question Converting from small to larger data type is known as ____.
A promotion
B operator
C polymorphism
D none of the above
Answer A
Marks 1
Unit II
Id 20
Question what are the types of type conversion
A implicit
B explicit
C both a and b
D none of the above
Answer C
Marks 1
Unit II
Id 21
Question Reusability is supported by following feature
A polymorphisms
B message passing
C inheritance
D operator overloading
Answer C
Marks 1
Unit II
Id 22
Question Deriving a new class from a base class is known as __.
A polymorphisms
B inheritance
C message passing
D operator overloading
Answer B
Marks 1
Unit II
Id 23
Question Base class is also known as___.
A super class
B parent class
C both a and b
D none of the above
Answer C
Marks 1
Unit II
Id 24
Question Child class is also known as
A sub class
B derived class
C both a and b
D known class
Answer C
Marks 1
Unit II
Id 25
Question Derived class___ cannot access from base class
A constructor
B destructors
C copy constructor
D all of the above
Answer D
Marks 1
Unit II
Id 26
Question we can derive a new class from a derived class
A true
B false
C
D
Answer A
Marks 1
Unit II
Id 27
Question How many parameter does a conversion operator take?
A 0
B 2
C 3
D as many as possible
Answer A
Marks 1
Unit II
Id 28
Question __is used to define pure virtual function?
A &
B =0
C @
D *
Answer B
Marks 1
Unit II
Id 29
Question Which is also known as abstract class?
A virtual function
B pure virtual function
C derived class function
D base class function
Answer B
Marks 1
Unit II
Id 30
Question pick the correct option
A We can make the instance of the abstract class
B We can not make the instance of the abstract class
C both a and b
D none of the above
Answer B
Marks 1
Unit II
Id 31
Question How many access specifiers are there in c++?
A 2
B 3
C 5
D 4
Answer B
Marks 1
Unit II
Id 32
Question Where we have to use an abstract class?
A in base class only
B in derived class only
C both and b
D None of the above
Answer A
Marks 1
Unit II
Id 33
Question For what we can apply access
A function
B data member
C none of the above specifier
D both a and c
Answer D
Marks 1
Unit II
Id 34
Question What is default access specifier for class?
A public
B protected
C private
D none of the above
Answer C
Marks 1
Unit II
Id 35
Question We have to define a constructor for the derived class must be required____.
A if base class constructor does not require arguments
B if base/parent class constructor required arguments
C no need
D always
Answer B
Marks 1
Unit II
Id 36
Question Use of the friend function is___.
A the class allowing access to another class
B the private section of a class
C the public section of the class
D all of the above
Answer D
Marks 1
Unit II
Id 37
Question If an attribute is private define then which method can have access to it
A only static function
B only functions of that class
C only method in that package
D none of the above
Answer B
Marks 1
Unit II
Id 38
Question What is syntax of deriving a new class from base class is___.
A class name, new class name
B new class name, base class name
C class name: access specifier class name
D none of the above
Answer C
Marks 1
Unit II
Id 39
Question Which constructor will initialize the base class data member
A base class
B derived class
C derived derived class
D none of these
Answer A
Marks 1
Unit II
Id 40
Question Inheritance can be done using :: symbol
A True
B False
C
D
Answer B
Marks 1
Unit II
Id 41
Question When we derived a new class using more than one class then type of inheritance is known
as____.
A multiple inheritance
B single inheritance
C hybrid inheritance
D multilevel inheritance
Answer A
Marks 1
Unit II
Id 42
Question When class B is derive from A , and class C is derived from B, this kind of inheritance is
known as ______.
A multiple inheritance
B single inheritance
C hybrid inheritance
D multilevel inheritance
Answer D
Marks 1
Unit II
Id 43
Question The base class will provide you__________.
A specific objects than the derived class
B more generalized version of derived class
C empty template of base class
D all of the above
Answer B
Marks 1
Unit II
Id 44
Question Pick up the correct statement form following
i)we have to use abstract keyword to define the abstract class
ii)inheritance allows multilevel class hierarchies more than two levels also
iii)reusability is supported by derivation
iv) we can change the meaning of operator during operator overloading
A i only
B ii only
C i and ii only
D ii and iii only
Answer D
Marks 2
Unit II
Id 45
Question What does derived class does not inherit from the base class
i)constructor
ii)destructor
iii)operator=()
iv)friends
A i and ii
B ii and iii
C only i, iii and iv
D all of the above
Answer D
Marks 1
Unit II
Id 46
Question Choose the correct the statement from following
i)inheritance supported in terms of single, multiple , multilevel ,hybrid inheritance
ii) polymorphisms is supported by function overloading , operator overloading and
virtual function
iii) abstraction is not supported by c++
A i is correct
B only ii is correct
C i and ii is correct
D none of the above
Answer C
Marks 1
Unit II
Id 47
Question _____types of classes in c++.
A 1
B 2
C 3
D 4
Answer C
Marks 1
Unit II
Id 48
Question :_______is used to define a pure virtual function.
A $
B ^
C =0
D #
Answer C
Marks 1
Unit II
Id 49
Question Pick up the correct statement
A a base class may have more than one class
B derived class can be derived from more than one class
C both a and b
D none of the above
Answer C
Marks 1
Unit II
Id 50
Question class A: public B, public C is a type of inheritance
A Single
B Multiple
C Multilevel
D Hybrid
Answer B
Marks 1
Unit II
Id 51
Question When we have to use the mutable keyword
A data member to change within a const member function
B not allow the data member to change within a const member function
C it will copy the values of the variable
D none of the above mentioned
Answer A
Marks 1
Unit II
Id 52
Question choose the correct statement
A destructor cannot be inherited
B private member not inherited to derived class
C constructor cannot inherited
D a and c
Answer D
Marks 1
Unit II
Id 53
Question Use of function or operator to act different ways on different data type is called as
A derivation
B inheritance
C polymorphisms
D none of the above
Answer C
Marks 1
Unit II