Page 474 - Computer science 868 Class 12
P. 474
MIND DRILL
Solved Questions
A. Tick ( ) the correct option:
1. Which of the following is not the type of inheritance?
a. Multilevel b. Interface
c. Hierarchical d. Multiple
2. Which of the following allows us to implement multiple inheritance in Java?
a. Overloading b. Overriding
c. Interface d. Inheritance
3. If the base class and subclass have same variable names, which keyword should be used to access the base class variable?
a. parent b. this
c. super d. base
4. Which of these keywords can be used to prevent inheritance of a class?
a. super b. constant
c. class d. final
5. Which of the following statements is the correct declaration about implementing two interfaces A and B by class C?
a. class C implements A, B b. class C implements A, implements B
c. class C implements A extends B d. class A, B implements c
6. Which of the following is not true for abstract class?
a. It should start with the keyword abstract. b. It has only abstract methods.
c. It can be instantiated. d. It has both abstract and regular methods.
7. Dynamic binding means ………………… .
a. linking of function call with function signature at compile time
b. linking of function call with function signature during coding
c. linking of function call with function signature at run time
d. None of these
8. Overloading is an example of ………………… .
a. static binding b. dynamic binding
c. cross binding d. lace binding
9. Which of the following access specifier can be used for a class so that its members can be accessed by a different class in the same
package?
a. Public b. Protected
c. No Modifier d. All of these
10. In multiple inheritance, a derived class inherits the properties of ………………… .
a. multiple derived classes b. multiple base classes
c. multiple final classes d. All of these
Answers
1. b 2. c 3. c 4. d 5. a 6. b 7. c
8. a 9. b 10. b
B. Fill in the blanks:
1. If a class derived from a base class becomes the base class of another derived class, then the new derived class can access the
properties of the previous base class. This is the ………………… nature of inheritance.
2. The extends keyword can be used to inherit both classes and ………………… in Java.
3. ………………… members are accessible in all the classes within or outside the package.
4. A combination of two or more inheritance is called ………………… inheritance.
472472 Touchpad Computer Science-XII

