Computer Applications

Assertion (A) Class initialisation is the explicit initialisation of class fields to values.
Reason (R) Each class field explicitly initialises to a value via a class field initialiser.

  1. Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A).
  2. Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion (A).
  3. Assertion (A) is true and Reason (R) is false.
  4. Assertion (A) is false and Reason (R) is true.

Java Constructors

8 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 constructors are invoked at the time of instance creation which assign values to various class fields. Reason (R) is true as constructors initialize values to class fields. Thus, Reason (R) explains Assertion (A).

Answered By

5 Likes


Related Questions