Programming - Methods in Java
You Are Here :: Home > JAVA > Methods in Java - General Questions
25. |
How many types of instance methods?
|
A. |
1 |
B.
|
2 |
C.
|
3
|
D.
|
more than 5
|
|
Answer: Option B
Explanation:
two types of Instance methods.they are 1)Accessor 2)Mutator. |
|
26. |
_________________________ methods are the methods that simply access or read the instance variables.
|
A. |
Accessor |
B.
|
Mutator |
C.
|
Both
|
D.
|
none
|
|
Answer: Option A
Explanation:
Accessor methods are the methods that simply access or read the instance variables. |
|
27. |
Can Accessor methods do not modify the instance of variable?
|
A. |
Yes |
B.
|
No |
C.
|
cant say
|
D.
|
may be
|
|
Answer: Option A
Explanation:
Yes,we cannot modify the instance of variables while methods are accessor. |
|
28. |
_____________ methods not only access the instance variables but also modify them
|
A. |
Accessor |
B.
|
Mutator |
C.
|
Both
|
D.
|
none
|
|
Answer: Option B
Explanation:
Mutotar methods not only access the instance variables but also modify them. |
|
29. |
How are objects are passes to methods in Java?
|
A. |
Pass by Value |
B.
|
Pass by Reference |
C.
|
Both
|
D.
|
Call by Value
|
|
Answer: Option D
Explanation:
Through Call by Value objects are passed to methods in Java. |
|
30. |
A method calling itself is called as _______________________ method.
|
A. |
recursive |
B.
|
static |
C.
|
non static
|
D.
|
instance
|
|
Answer: Option A
Explanation:
A method calling itself is called Recurion. |
|
« prev
next »