A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

71. How many constructors can a class have?
a. 0
b. 1
c. 2
d. any number
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).any number

72. The new operator
a. returns a pointer to the variable
b. creates a variable called new
c. obtains memory for a new variable
d. tells how much memory is available
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).obtains memory for a new variable

73. Consider the following statements:
int x = 22,y=15;
x = (x>y) ? (x+y) : (x-y);
What will be the value of x after executing these statements?
a. 22
b. 37
c. 7
d. Error. Cannot be executed
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).37

74. An exception is caused by
a. a hardware problem
b. a problem in the operating system
c. a syntax error
d. a run-time error
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).a run-time error

75. A template class
a. is designed to be stored in different containers
b. works with different data types
c. generates objects which must be identical
d. generates classes with different numbers of member functions
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).works with different data types

76. Which of the following is the valid class declaration header for the derived class d with base classes b1 and b2?
a. class d : public b1, public b2
b. class d : class b1, class b2
c. class d : public b1, b2
d. class d : b1, b2
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).class d : public b1, public b2

77. A library function exit() causes an exit from
a. the loop in which it occurs
b. the block in which it occurs
c. the function in which it occurs
d. the program in which it occurs
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).the program in which it occurs

78. RunTime polymorphism is achieved by ___________
a. friend function
b. virtual function
c. operator overloading
d. function overloading
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).virtual function

79. An array element is accessed using
a. a FIFO approach
b. an index number
c. the operator
d. a member name
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).an index number

80. If there is a pointer p to object of a base class and it contains the address of an object of a derived class and both classes contain a virtual member function abc(), then the statement p->abc(); will cause the version of abc() in the __________class to be executed.
a. Base Class
b. Derived class
c. Produces compile time error
d. produces runtime error
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).Derived class