Computer Applications
Assertion (A) The return statement causes program control to transfer back to the caller of the method.
Reason (R) The return statement immediately terminates the method in which it is executed.
- Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A).
- Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion (A).
- Assertion (A) is true and Reason (R) is false.
- Assertion (A) is false and Reason (R) is true
User Defined Methods
4 Likes
Answer
Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A).
Reason — Assertion (A) is true as the return statement causes program control to transfer back to the caller of the method. Reason (R) is also true as the return statement immediately terminates the method in which it is executed and the control transfers back to the caller method. Thus, Reason (R) correctly explains Assertion (A).
Answered By
2 Likes
Related Questions
Assertion (A) Method should be called explicitly either with object reference or class reference.
Reason (R) Method can be any user defined name.- Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A).
- Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion (A).
- Assertion (A) is true and Reason (R) is false.
- Assertion (A) is false and Reason (R) is true.
Read the following text and choose the correct answer:
Public access specifier allows a class to expose its member variables and member functions to other functions and objects. Any public member can be accessed from outside the class.
Which of these access specifier must be used for class so that it can be inherited by another subclass?
- public
- private
- protected
- none of the mentioned
Correct statement to declare an integer array of 10 elements.
- int[ ] arr = new int[10];
- int arr;
- int arr (10);
- int ( ) arr = new int (10);
Write the values of r and s after the execution of the following code.
int p = 11, q = 21, r, s; r = ++q; s = p++; r++;