Professional Documents
Culture Documents
17) How many VPTR is created internally for a base class and a derived class
i) 0
ii) 1
iii) 2
iv) 3
18) Number of virtual table created for a base and a derived class is
i) 0
ii) 1
iii) 2
iv) 3
19) Interface class in C++ is created by
i) Using interface keyword before class
ii) Using pure virtual function
iii) Using pure virtual function and virtual function both
iv) Using class keyword
20) Which statements are true about an abstract class
i) Abstract class has at least one pure virtual function.
ii) Pointer for an abstract class can be created
iii) Object of an abstract class cannot be created.
iv) All are correct.
21) Run time polymorphism in C++ Program is
i) New and delete operator overloading
ii) ++ and – – operator overloading
iii) :: operator overloading
iv) None
22) Run time binding is related to
i) Function overriding
ii) Operator overloading
iii) A & B
iv) None
23) Which function cannot be overloaded in C++
i) Constructor
ii) Class destructor
iii) Both a & b
iv) None
24) Operators can be overloaded in C++ is/are
i) New
ii) Delete
iii) ++
iv) All can be overloaded
OOPS
25) Inheritance base class and derived class relationship comes under
i) Inheritance
ii) Polymorphism
iii) encapsulation
iv) None
26) C++ Inheritance relationship is
i) Association
ii) Is-A
iii) Has-A
iv) None
27) Types of inheritance in C++ are
i) Multilevel
ii) Multiple
iii) Hierarchical
iv) All the above
28) Inheritance allow in C++ Program?
i) Class Re-usability
ii) Creating a hierarchy of classes
iii) Extendibility
iv) All
29) Functions that can be inherited from base class in C++ program
i) Constructor
ii) Destructor
iii) Static function
iv) None
30) Which members of base class are inaccessible to derived class
i) Private
ii) Protected
iii) Public
iv) None
31) Accessing functions from multiple classes to a derived class is known as
i) multiple inheritance
ii) single inheritance
iii) Hybrid inheritance
iv) multilevel inheritance
32) In inheritance, order of execution of base class and derived class destructors are
i) Base to derived
ii) Derived to base
iii) Random order
iv) None
OOPS
33) In C++, Class object created statically(e.g. Car obj; and dynamically (Car *obj = new Car() ; ) are
stored in memory
i) Stack, heap
ii) Heap, heap
iii) Heap, stack
iv) Stack, stack
34) True statement about Class and structure in C++ is
i) Default access specifier is private in class and public in structure
ii) Way of creating objects of class and structure are different
iii) Way of inheriting class and structure are different
iv) None
35) In C++ programming, cout is a/an
i) Function
ii) Operator
iii) Object
iv) Macro
36) Which is Abstract Data Type in C++
i) Class
ii) Int
iii) Float
iv) array
37) Class allows only one object of it to be created though out the program life cycle
i) Singleton class
ii) Abstract class
iii) Friend class
iv) All classes
38) Statically allocated object for class A in C++ is
i) A *obj = new A();
ii) A obj;
iii) A obj = new A();
iv) None
39) When you create an object of a class A like A obj ; then which one will be called automatically
i) Constructor
ii) Destructor
iii) Copy constructor
iv) Assignment operator
40) When you create an object of a derived class in C++
i) Derived class constructor is called first then the base class constructor
ii) Base class constructor is called first then derived class constructor
iii) base class constructor will not be called
iv) none of the above
OOPS
41) The class in C++ which act only as a base class and object of it cannot be created is
i) parent class
ii) super class
iii) abstract class
iv) none of the above
42) Which operator is used to allocate an object dynamically of a class in C++?
i) Scope resolution operator
ii) Conditional operator
iii) New operator
iv) Membership access