Answer:
Option (B) A reference to an object of that class
Step-by-step explanation:
- The method's return type is nothing but a class ( the data type ).
- The method contains some statements that has to be executed.
- The method involves returning the reference of an object but not the object itself.
- The method returns the reference of the object ( address in the memory space of that particular object) created in the memory for accessing.
- Lets us take this example
below:
![public\, int \,SumofIntegers (int\, a, int\, b)\{sum = a + b ;return\, sum;\}](https://img.qammunity.org/2020/formulas/computers-and-technology/college/gh9x3wpbjua808jgrg4wd5j9hd6x28mavx.png)
- When the above method SumofIntegers is called it is returning sum ( which is referencing to the object of the class int (as a and b are of int type here ))
- Here sum is a variable but not the object of a class.
- So, option (A) is false, as it is returning the sum (a reference to the object)
- Option (C) is false. method returns the reference of the object not just the value. In case of void the value is null.
- Option (D) is false. Return type is not just for the documentation.