Page 279 - ComputerScience_Class_11
P. 279
MIND DRILL
Solved Questions
A. Tick ( ) the correct option.
1. Why are methods useful?
a. They reduce the size of the coding. b. They occupy less space in memory.
c. They reduce the burden of debugging a long program. d. All of these
2. What is the first line of any method definition called?
a. Method footer b. Method header
c. Signature d. None of these
3. Which of the following is the identification of name of the method along with its parameter list in the method header?
a. Access specifier b. Method Signature
c. Both a and b d. None of these
4. Which of the following keywords allows the methods to be assessed by the same class only?
a. Public b. Protected
c. Default d. Private
5. Which of the following statements sends back a value from the method to the caller program?
a. Protected b. Return
c. Parameter d. Body of the loop
6. Where is the actual parameter defined?
a. Calling method b. Called program
c. Pass by value d. Pass by reference
7. Which of the following methods is a type of pure method (if they don’t modify state)?
a. Pure method b. Impure method
c. Mutator d. None of these
8. What is the fundamental unit of object-oriented programming called?
a. Class b. Object
c. Method d. Data members
9. How many types of access specifiers are used in Java?
a. 1 b. 2
c. 3 d. 4
10. The class variable is also known as ………………… .
a. static data member b. non-static data member
c. instance variable d. None of these
Answers
1. d 2. b 3. b 4. d 5. b 6. a 7. a 8. b 9. c 10. a
B. Fill in the blanks.
1. Every method should have a …………………, so that it can be called from the same class or different classes.
2. The method header is also known as ………………… .
3. ………………… are blocks of statements in a program that perform a specific task and can be reused as and whenever required.
4. The keyword ………………… allows only the methods to be accessed by the same class.
5. A ………………… is a loop within a loop.
6. Defined methods in a class are termed as ………………… .
Methods and Constructors 277

