Computer Applications

What is the role of a return statement in a method ?

User Defined Methods

7 Likes

Answer

The return statement is useful in two ways:

  1. As soon as a return statement is encountered, the control is returned to the calling method.
  2. It is used to return a value to the method call statement.

Answered By

3 Likes


Related Questions