1. Inline functions are invoked at the time of a) Run time
b) Compile time
c) Depends on how it is invoked d) Both b and c above
2.Which of the following operators below allow to define the member functions of a class outside the class?
a) ::
b) ? c) :? d) %
3.Every class has at least one constructor function, even when none is declared.
a) True
b) False
4. How do we define a destructor? a) X~() {}
b) X() {}~ c) X() ~{}
d) ~X() {}
5. Can constructors be overloaded? a) No
b) Yes
6. Which of the following below can perform conversions between pointers to related classes? a) cast_static
b) dynamic_cast
c) static_cast
d) cast_dynamic
7. An abstract class can be instantiated. a) True
b) False
8. The default access level assigned to members of a class is ___________
a) Private
b) Public c) Protected
d) Needs to be assigned
9. Which classes allow primitive types to be accessed as objects? a) Storage
b) Virtual c) Friend
d) Wrapper
10. Which of the following below is /are a valid iterator type? a) Input Iterator
b) Backward Iterator c) Forward Iterator
d) Both a and c above
11. What is the difference between overloaded functions and overridden functions?
a) Overloading is a dynamic or run-time binding and Overriding is static or compile-time binding
b) Redefining a function in a friend class is called function overriding while Redefining a function in a derived class is called a overloaded fucntion.
c) Overloading is a static or compile-time binding and Overriding is dynamic or run-time binding
d) Redefining a function in a friend class is called function overloading while Redefining a function in a derived class is called as overridden fucnion.
12. What is shallow copy?
a) A shallow copy creates a copy of the dynamically allocated objects too.
b) A shallow copy just copies the values of the data as they are.
c) A shallow copy creates a copy of the statically allocated objects too d) Both b and c above
13. Which of the following library function below by default aborts the program? a) Terminate()
b) end() c) Abort()
d) exit()
14. What defines a general set of operations that will be applied to various types of data? a) Template class
b) Function template
c) Class template d) Both a and c above
15. What happens when a pointer is deleted twice? a) It can abort the program
b) It can cause a failure c) It can cause an error d) It can cause a trap 16. What is deep copy?
a) A deep copy creates a copy of the dynamically allocated objects too.
b) A deep copy just copies the values of the data as they are. c) A deep copy creates a copy of the statically allocated objects too d) Both b and c above
17. There is nothing like a virtual constructor of a class. a) False
b) True
18. What is the Difference between struct and class in terms of Access Modifier?
a) By default all the struct members are private while by default class members are public. b) By default all the struct members are protected while by default class members are
private.
c) By default all the struct members are public while by default class members are private.
d) By default all the struct members are public while by default class members are protected. 19. Vtables
a) creates a static table per class
b) creates a static table per object c) creates a dynamic table per class d) creates a dynamic table per object
20. C++ provides facility to specify that the compiler should match function calls with the correct definition at the run time. This process is called as
a) Static binding
b) Dynamic Binding
21.What are the major elements in an object model? a) Abstraction, Encapsulation and persistence b) Hierarchy, concurrency and typing
c) Abstraction, encapsulation and hierarchy
d) Typing
22.The characteristics of an object that distinguish it from all other kinds of objects a) Aggregation
b) Abstraction
c) Modularity
d) None of the above 23.Shallow copy is defined as
a) Member wise copying of the object b) Same as deep copy
c) Bitwise copying of objects
d) None of the above
24.OOP allows for extension of the objects functions or of class functions. This is called as a) Extendibility
b) Expansion capacity c) Virtual extension d) Scalability
25.In OOPS unit of data is called as a) Bits
b) Blocks
c) Structures
d) Targets
26.Which of the following is not a type of object oriented abstraction? a) Abstraction of data
b) Abstraction of function c) Abstraction of structure
d) Abstraction of name
a) It means the function is only a read-only function
b) One which always returns the same values, given the same arguments c) Used for constructor and destructor
d) None of the above 28.What makes a class abstract?
a) The class must not have method definitions.
b) The class must have a constructor that takes no arguments. c) The class must have a function definition equal to zero.
d) The class which cannot be instantiated as they are mainly for inheritance.
29.What is dynamic dispatch?
a) When the function to be executed in response to a function call is determined at run-time.
b) When the function to be executed in response to a function call is determined at compile- time.
c) When the function to be executed in response to a function call is determined at the end of the function call.
d) None of the above
30._____________ is actually a parameterized constructor which takes some parameters in order to create instance of a class.
a) Implicit constructor
b) Explicit constructor c) Virtual constructor
d) Parameterized constructor
31.There is no difference between an object and an instance.
a) False
b) True
32.A package is a namespace for organizing _____________ and interfaces in a logical manner a) instance
b) objects
c) classes
d) both b and c above
33. Common behavior can be defined in a superclass and inherited into a subclass using the ___________ keyword
b) extends
c) extend d) inherits
34.Which of the following below are different Creational patterns in OO design? a) Factory pattern
b) Single ton pattern c) Prototype pattern
d) all of above
35.If the child object can exist beyond the lifetime of its parent, then the relationship is ____________
a) Generalization b) Composition
c) Aggregation
d) Any of b and c above
36.Virtual inheritance is a kind of inheritance that can be used under __________ a) single inheritance
b) multi level inheritance
c) multiple inheritance
d) both a and d
37.Constructors have to be called before the main function
a) True
b) False
38.__________ allows for the separation of object interactions from classes and inheritance into distinct layers of abstraction
a) Dispatching b) Loosening c) Detaching
d) Decoupling
39.The ____________ functions of the base class are also not inherited a) Both a and d
b) Pure virtual function
c) Friend
40.A recursive function would result in infinite recursion, if the following were left out: a) Base call
b) Recursive call c) Subtraction
d) Local variable declarations
41.____________ is a style of dynamic typing in which an object's current set of methods and properties determines the valid semantics.
a) duck overcast b) duck retype c) duck semantic
d) duck typing
42.What is the user of parametric polymorphism?
a) A function or a data type can be written generically so that it can handle values identically without depending on their type
b) A function or a data type can be written generically so that it can handle values identically being dependant on their type
c) A function or a data type that can accept parameters d) Both a and c
43.In dynamic type case a type safety check is incurred at ____________
a) Compile time
b) Run time
44.Operator overloaded is?
a) Making C++ operators works with objects b) Giving new meaning to existing C++ operators c) Making new C++ operator
d) Both a and b
45.Overloaded function in C++?
a) A group function with the same name
b) All have the same number and type of arguments
c) Function with same name and same number and type of arguments. d) All of the above
46.A class having no name? a) Is not allowed
b) Can?t have a destructor
c) Can?t have a constructor
d) Can?t be passed as an argument 47.A destructor takes?
a) One argument b) Two arguments c) Three arguments
d) Zero arguments
48.Constructors are use to? a) Initialize the objects
b) Construct the data members c) Both a and b
d) A method
49.The fields in a class of a C++ program are by default? a) Protected
b) Public
c) Private
d) None of these
50.In C++ a function contained with in a class is called? a) A member function
b) An operator c) A class function d) A method
51.__is an OOP Language? a) Basic
b) Fortan c) C++
d) Cobol
52. __allows you to create a derived class that inherits properties from more than one base class? a) Multilevel inheritance
b) Multiple inheritance
c) Hybrid Inheritan
53. __feature in OOP allows reusing code? a) Polymorphism
b) Inheritance
c) Encapsulation d) Data hiding
54. __A class that declares or inherits a virtual function is called? a) Encapsulation class
b) Inherited class
c) Polymorphic class
d) static class
55. __C++ header file that handles input output functions is? a) iostream.h
b) iomanip.h c) string.h d) fstream.h
56. __are bound dynamically at run time? a) static class
b) virtual function
c) friend function d) inline function
57. __pointers are not modifiable? a) that
b) this
c) Indirection d) Address
58. __classes are used in cases where one class is tightly coupled to another class? a) Abstract
b) friend
c) static d) virtual
59. __The extension of C++ source file is? a) txt
c) .c
d) .cpp
60. The __ keyword/s do not apply to friend functions, as the class has no controlover the scope of friends?
a) public b) protected c) private
d) both A and B
61. The extension of C++ object code is __? a) .obj
b) .cpp c) .ppt d) .xls
62. __do not break encapsulation, but rather enhance a class interface? a) Static functions
b) Friend functions
c) Dynamic functions d) none of these
63. The function---will return the last read character and will move the inside pointer one with-1 char?
a) putback()
b) flush() c) peek() d) getline().
64. __is an identifier that can be inserted into an output stream or extracted from an input stream in order to produce a desired effect?
a) Stream
b) Manipulator
c) this d) Flag
65. The error occurring due to missing semicolon is ___? a) Syntax
c) Linker d) Runtime
66. __Identify the modulators from the following list. i. endl ii. hex iii. Auto iv. Default? a) i only
b) ii only c) both i and ii
d) all of these
67. __Which of these manipulator is used to insert null character in a string? a) endl
b) ends
c) unitbuf d) setfill
68. __Which of these file open mode you use to delete all previous content in the file? a) ios :: ate
b) ios ::in c) ios:: app
d) ios::trunc
69. A class generated from a class template is called ---? a) Inherited class
b) generated class
c) derived class d) base class
70. The size of an int variable in C++ is ___bytes? a) 4
b) 2
c) 1 d) 8
71. __is very useful when templates of template come into usage? a) friend function
b) static function
c) typedef
d) Inheritance e)
72. Which of these c++ feature allow you to create classes that are dynamic in terms of the types of data they can handle?
a) Inheritance
b) Templates
c) Polymorphism d) information hiding
73. Create the required classes by plugging in the actual type for the type parameters, this process is commonly known as __?
a) Instantiating a class
b) encapsulation of class c) booting of class d) none of these
74. The exception specification is like a--- It tells the user to write exception handling code and what exceptions to handle?
a) library file
b) function prototype
c) header file d) built-in function
75. The size of an double variable in C++ is ____bytes? a) 10
b) 2 c) 4
d) 8
76. Which of these exception reports a failure to allocate storage? a) bad_cast
b) bad_typeid c) length_error
d) none of these
77. Stack is an example for ---structure? a) LIFO
b) FIFO c) SISO d) LILO
78. The standard sequence containers include --- i) vector
ii) deque iii)list iv) stack
a) i) and ii) only b) i),ii) and iii)
c) iii) and iv) only d) i),ii),iii) and iv)
79.What punctuation ends most lines of C++ code? a) . (dot)
b) ; (semi-colon)
c) : (colon) d) ' (single quote)
80.Can I inherit the constructor and destructor of a base class? a) No
b) Yes
81.What punctuation is used to signal the beginning and end of code blocks? a) { }
b) -> and <-
c) BEGIN and END d) ( and )
1) (b) 2) (a) 3) (a) 4) (d) 5) (b) 6) (c) 7) (b) 8) (a) 9) (d) 10) (d) 11) (c) 12) (b) 13) (d) 14) (b) 15) (c) 16) (a) 17) (a) 18) (c) 19) (a) 20) (b) 21) (c) 22) (b) 23) (c) 24) (d) 25) (c) 26) (d) 27) (a) 28) (d) 29) (a) 30) (a) 31) (a) 32) (c) 33) (b) 34) (d) 35) (c) 36) (c) 37) (a) 38) (d) 39) (c) 40) (a) 41) (d) 42) (a) 43) (a) 44) (d) 45) (a) 46) (b) 47) (d) 48) (a) 49) (c) 50) (a) 51) (c) 52) (b) 53) (b) 54) (c) 55) (a) 56) (b) 57) (b) 58) (b) 59) (d) 60) (d) 61) (a) 62) (b) 63) (a) 64) (b) 65) (a) 66) (d) 67) (b) 68) (d) 69) (b) 70) (b) 71) (c) 72) (b) 73) (a) 74) (b) 75) (d) 76) (d) 77) (a) 78) (b) 79) (b) 80) (b) 81) (a)