72.2k views
0 votes
What statement is used to specify the value that a method gives back to its caller?

a) new
b) public
c) private
d) return

1 Answer

0 votes

Final answer:

The 'return' statement is used in a method to specify the value that it gives back to the caller, which must match the method's declared return type.

Step-by-step explanation:

The statement used to specify the value that a method gives back to its caller is the return statement. When a method needs to send a result back to the line of code that invoked it, the return keyword is used followed by the value to be returned. This can be a variable, an expression, or a literal value. The returned value must match the method's declared return type.

User Alialtansaka
by
7.9k points