User Define Method
User Define Method
User-Defined Methods
Mental Drill
a. Interface b. Reusability
Ans. b. Reusability
a. int b. no-return
Ans. c.
Ans. a.
Ans. b.
Ans. a.
Ans. a. 1
Ans. a.
Ans. a.
a. public b. private
Ans. c.
reference.
overloading.
SECTION A
1.
Ans.
129
2.
Ans.
3.
Ans.
4.
Ans.
5. Name the keyword that causes the control to transfer back to the method call.
Ans. return
6.
Ans.
7.
Ans.
8.
Ans.
9.
Ans.
list.
10.
Ans.
11.
Ans.
Call by Reference
Using this technique a copy of the values in Using this technique a reference to the values
parameters. parameters.
parameters.
12.
(i)
Ans.
13.
Ans.
14.
Ans.
else
else
131
else
15.
Ans.
16.
Ans.
17.
Ans.
18.
Ans.
19.
Ans.
operator.
1. Private access method sum which accepts three int type variables as parameters and return a
Ans.
2. Default access method “length” which accepts a String type variable as parameter and returns
an int type.
Ans.
3. Public access method “increment” which accepts an object of Myclass type as parameter and
does not return any value.
Ans.
4.
parameters and have a byte type as return type.
Ans.
5.
Ans.
6.
Ans.
7.
a value which is either ‘true’ or false’.
Ans.
1.
int y = 2;
int a= 6;
Ans.
133