Object Oriented Programming Oop Set 4
Object Oriented Programming Oop Set 4
Object Oriented Programming Oop Set 4
[set-4]
q M
c the concept of super class and subclass?
78. Which feature of C++ contain
A. class and object M
B. encapsulation
C. abstraction
D. inheritance
Answer: D
80. If particular software can be used in some other application than the one for
which it is created then it reveals ….........
A. data binding
B. data reusability
C. data encapsulation
D. none of these
Answer: B
81. Which of the following data type does not return anything?
A. int
B. short
C. long
D. void
Answer: D
83. Which of the following statements is correct for a static member function?
1. It can access only other static members of its class.
? It can be called using the class name, instead of objects
A. only 1 is correct
B. only 2 is correct
C. both 1 and 2 are correct
D. both 1 and 2 are incorrect
Answer: C
84. What happens when a class with parameterized constructors and having no
default constructor is used in a program and we create an object that needs a zero-
argument constructor?
A. compile-time error
B. preprocessing error
C. runtime error
D. runtime exception
Answer: A
91. Which of the following is true about new when compared with malloc. 1) new is
an operator, malloc is a function 2) new calls constructor, malloc doesn't 3) new
returns appropriate pointer, malloc returns void * and pointer needs to typecast to
appropriate type.
93. What happens when delete is used for a NULL pointer? int *ptr = NULL;
delete ptr;
A. compile time error
B. run time error
C. no effect
Answer: C
95. Which of the followings is/are automatically added to every class, if we do not
write our own.
A. copy constructor
B. assignment operator
C. a constructor without any parameter
D. all
Answer: D