Advertisements
Advertisements
प्रश्न
Assertion(A): call by value is known as pure method.
Reason(R): The original value of variable does not change as operation is performed on copied values.
विकल्प
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.
MCQ
अभिकथन और तर्क
Advertisements
उत्तर
Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A).
Explanation:
- The Assertion is True: A method is considered "pure" if it does its job without changing the outside data (no side effects).
- The Reason is True: Call-by-value makes a separate copy of the variable for the method to use.
- The explanation matches: Because the method only works on a copy, the original value never changes. This lack of side effects is exactly what makes it a pure method.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
