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.

81. Match the following:

Set-I
(a) Garbage collection in
(b) Nameless object
(c) Template support
(d) A forward reference
(e) Derived class inherits from base class

Set-II
1. Java
2. generic programming
3. defines a class
4. member function
5. within a statement

Codes :
    (a) (b) (c)  (d)  (e)
a. 1   5   4    2     3
b. 1   5   2    3     4
c. 5   1   2    3     4
d. 5   4   3    1     2
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).1   5   2    3     4

82. The data type created by the data abstraction process is called
a. class
b. structure
c. abstract data type
d. user defined data type
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).abstract data type

83. What would be the output of the following program, if run from the command line as “myprog 1 2 3”?

main (int argc, char * argv[ ])
{  int i ;
i = argv[1] + argv[2] + argv[3] ;
printf (“% d”, i) ;
}
a. 123
b. 6
c. Error
d. “123”
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Error

84. A …………….. is a special method used to initialize the instance variable of a class.
a. Member function
b. Destructor
c. Constructor
d. Structure
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Constructor

85. What is the value of ‘b’ after the execution of the following code statements:

C=10;
B=++c+++c;
a. 20
b. 22
c. 23
d. None of the above
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).None of the above

86. Which of the following does not represent a valid storage class in ’c’?
a. automatic
b. static
c. union
d. extern
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).union

87. The friend functions are used in situations where:
a. We want to have access to unrelated classes
b. Dynamic binding is required
c. Exchange of data between classes to take place
d. None of the above
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Exchange of data between classes to take place

88. Which one of the following describes correctly a static variable?
a. It cannot be initialized
b. It is initialized once at the commencement of execution and cannot be changed at run time
c. It retains its value during the life of the program
d. None of the above
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).It retains its value during the life of the program

89. The output of the program code

main()
{
int x=0;
while (x<=10)
for(;;)
if(++x%10==0)
break;
printf(“x=%d”,x);
}

is :
a. x=1
b. compilation error
c. x=20
d. none of the above
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).x=20

90. A copy constructor is invoked when:
a. a function returns by value
b. an argument is passed by value
c. a function returns by reference
d. none of the above
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).an argument is passed by value