OOPS
OOPS
A
Virtual class
.
B.Abstract class
C.Singleton class
D
Friend class
.
A
Copy constructor
.
B.Friend constructor
C.Default constructor
D
Parameterized constructor
.
A
Base class pointer cannot point to derived class.
.
B.Derived class pointer cannot point to base class.
C.Pointer to derived class cannot be created.
D
Pointer to base class cannot be created.
.
A
Static function
.
B.Friend function
C.Const function
D
Virtual function
.
5. Which of the following concepts means determining at runtime what method to invoke?
A
Data hiding
.
B.Dynamic Typing
C.Dynamic binding
D
Dynamic loading
.
6. Which of the following term is used for a function defined inside a class?
A
Member Variable
.
B.Member function
C.Class function
D. Classic function
A
Call by value
.
D
B.Call by reference
.
C.Default arguments
D
Call by pointe
.
8. How many instances of an abstract class can be created?
A
1 B.5
.
C.13 D.0
A
Function
.
B.Class
C.Object
D
Operator function
.
10. Which of the following concepts of OOPS means exposing only necessary information to
client?
A
Encapsulation
.
B.Abstraction
C.Data hiding
D
Data binding
.
A
A reference can never be null.
.
B.A reference once established cannot be changed.
C.Reference doesn't need an explicit dereferencing mechanism.
D
All of the above.
.
A
operator B.Function
.
C.object D.Macro
13. Which of the following concepts provides facility of using object of one class inside
another class?
A
Encapsulation B.Abstraction
.
C.Composition D.Inheritance
A
1 B.2
.
C.3 D.4
A
Int B.Double
.
C.String D.Class
16. Which of the following concepts means adding new components to a program as it runs?
A
Data hiding
.
B.Dynamic typing
C.Dynamic binding
D
Dynamic loading
.
A
A constructor is called at the time of declaration of an object.
.
B.A constructor is called at the time of use of an object.
C.A constructor is called at the time of declaration of a class.
D
A constructor is called at the time of use of a class.
.
18. Which of the following correctly describes overloading of functions?
A
Virtual polymorphism
.
B.Transient polymorphism
C.Ad-hoc polymorphism
D
Pseudo polymorphism
.
A
Top-down B.Bottom-up
.
C.Right-left D.Left-right
A
The types of arguments are different.
.
B.The order of argument is different.
C.The number of argument is same.
D
Both A and B.
.
A
class can have member functions while structure cannot.
.
B.class data members are public by default while that of structure are private.
C.Pointer to structure or classes cannot be declared.
D
class data members are private by default while that of structure are public by default.
.
22. Which of the following concepts means wrapping up of data and functions together?
A
Abstraction B.Encapsulation
.
C.Inheritance D.Polymorphism
23. Which of the following concepts means waiting until runtime to determine which
function to call?
A
Data hiding
.
B.Dynamic casting
C.Dynamic binding
D
Dynamic loading
.
A
Using C++ tables
.
B.Using Virtual tables
C.Using Indexed virtual tables
D
Using polymorphic tables
.
A
>>
.
B.<<
C.+
D
=
.
26. Which of the following is the correct class of the object cout?
A
iostream
.
B.istream
C.ostream
D
ifstream
.
27. Which of the following cannot be used with the keyword virtual?
A
Class
.
B.member functions
C.constructor
D
destructor
.
A
Construct a new class
.
B.Construct a new object
C.Construct a new function
D Initialize objects
.
A
Missing semicolon in statement in main().
.
B.A problem in calling function.
C.A syntax error.
D
A run-time error.
.
30. Which one of the following options is correct about the statement given below? The
compiler checks the type of reference in the object and not the type of object.
A
Inheritance B.Polymorphism
.
C.Abstraction D.Encapsulation
31. Which of the following is the correct way of declaring a function as constant?
A
const int ShowData(void) { /* statements */ }
.
B.int const ShowData(void) { /* statements */ }
C.int ShowData(void) const { /* statements */ }
D
Both A and B
.
A
Virtual function
.
B.Operator function
C.Const function
D
Static function
.
A
C++ allows static type checking.
.
B.C++ allows dynamic type checking.
C.C++ allows static member function be of type const.
D
Both A and B.
.
34. Which of the following factors supports the statement that reusability is a desirable
feature of a language?
A
It decreases the testing time.
.
B.It lowers the maintenance cost.
C.It reduces the compilation time.
D
Both A and B.
.
35. Which of the following ways are legal to access a class data member using this pointer?
A
this->x
.
B.this.x
C.*this.x
D
*this-x
.
A
Operator overloading
.
B.Function overloading
C.Templates
D
All of the above
.
37. Which of the following is correct about the statements given below?
A
Only I is true.
.
B.Both I and II are false.
C.Only II is true.
D
Both I and II are true.
.
38. What happens if the base and derived class contains definition of a function with same
prototype?
39. Which of the following are available only in the class hierarchy chain?
A
Public data members
.
B.Private data members
C.Protected data members
D
Member functions
.
A
Multiple B.Multilevel
.
C.Distributive D.Hierarchical
A
[]
.
B.->
C
?:
.
D
*
.
42. In which of the following a virtual call is resolved at the time of compilation?
A
From inside the destructor.
.
B.From inside the constructor.
C.From inside the main().
D
Both A and B.
.
A
It speeds up execution.
.
B.It slows down execution.
C.It increases the code size.
D
Both A and C.
.
44. Which one of the following is the correct way to declare a pure virtual function?
A
virtual void Display(void){0};
.
B.virtual void Display = 0;
C.virtual void Display(void) = 0;
D
void Display(void) = 0;
.
45. Which of the following header file includes definition of cin and cout?
A
istream.h
.
B.ostream.h
C.iomanip.h
D
iostream.h
.
A
overload
.
B.operator
C.friend
D
override
.
A
It cannot have a destructor.
.
B.It cannot have a constructor.
C.It is not allowed.
D
Both A and B.
.
A
Multilevel inheritance
.
B.Multiple inheritance
C.Hybrid inheritance
D
Hierarchical Inheritance
.
49. Which one of the following is correct about the statements given below?
A
Only II is correct.
.
B.Both I and II are correct.
C.Only I is correct.
D
Both I and II are incorrect.
.
50. Which of the following is an invalid visibility label while inheriting a class?
A
public
.
B.private
C.protected
D
friend
.
A
Friend function can access public data members of the class.
.
B.Friend function can access protected data members of the class.
C.Friend function can access private data members of the class.
D
All of the above.
.
A
Classes cannot have data as protected members.
.
B.Structures can have functions as members.
C.Class members are public by default.
D
Structure members are private by default.
.
A
Declaring it abstract using static keyword.
.
B.Declaring it abstract using virtual keyword.
C.Making at least one member function as virtual function.
D
Making at least one member function as pure virtual function.
.
54. Which of the following access specifier is used as a default in a class definition?
A
protected B.public
.
C
private D.friend
.
A
A static member function can access only static data members of a class.
.
B.A static data member is shared among all the object of the class.
C.A static data member can be accessed directly from main().
D
Both A and B.
.
A
Abstraction
.
B.Inheritance
C.Dynamic binding
D
Encapsulation
.
A
Class is an instance of object.
.
B.Object is an instance of a class.
C.Class is an instance of data type.
D
Object is an instance of data type.
.
61. In a group of nested loops, which loop is executed the most number of times?
a. The outermost loop
b. All loops are executed the same number of times
c. the innermost loop
d. cannot be determined without knowing the size of the loops
63. Which looping process is best used when the number of iterations is known?
a. For c. do-while
b. While d all looping process require that the iterations be known
64. What's wrong? for (int k = 2, k <=12, k++)
a. the increment should always be ++k
b. the variable must always be the letter i when using a for loop
c. there should be a semicolon at the end of the statement
d. the commas should be semicolons