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.

91. The major goal of inheritance in c++ is:
a. To facilitate the conversion of data types
b. To help modular programming
c. To extend the capabilities of a class
d. To hide the details of base class
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).To extend the capabilities of a class

92. Consider the following class definitions:
class a
{
};
class b: protected a
{
};
What happens when we try to compile this class?
a. Will not compile because class body of a is not defined
b. Will not compile because class body of b is not defined
c. Will not compile because class a is not public inherited
d. Will compile successfully
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).Will compile successfully

93. Which of the following expressions is illegal?
a. (10| 6)
b. (false && true)
c. bool (x) = (bool)10;
d. float y = 12.67;
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).bool (x) = (bool)10;

94. The actual source code for implementing a template function is created when
a. The declaration of function appears
b. The function is invoked
c. The definition of the function appears
d. None of the above
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).The function is invoked

95. Which of the following statements are true in c++?
a. Classes can not have data as public members
b. Structures can not have functions as members
c. Class members are public by default
d. None of these
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).Structures can not have functions as members

96. What is the error in the following code?
class t
{
virtual void print();
}
a. No error
b. Function print() should be declared as static
c. Function print() should be defined
d. Class t should contain data members
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).No error

97. A white space is :
a. blank space
b. new line
c. tab
d. all of the above
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).all of the above

98. The following can be declared as friend in a class
a. an object
b. a class
c. a public data member
d. a private data member
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).a class

99. A copy constructor takes
a. no argument
b. one argument
c. two arguments
d. arbitrary no. of arguments
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).one argument

100. Overloading a postfix increment operator by means of a member function takes
a. no argument
b. one argument
c. two arguments
d. three arguments
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).no argument