Computer Applications
What is the role of a return statement in a method ?
User Defined Methods
6 Likes
Answer
The return statement is useful in two ways:
- As soon as a return statement is encountered, the control is returned to the calling method.
- It is used to return a value to the method call statement.
Answered By
2 Likes
Related Questions
When an argument is passed by reference,
- a variable is created in the function to hold the argument's value.
- the function cannot access the argument's value.
- a temporary variable is created in the calling program to hold the argument's value.
- the function accesses the argument's original value in the calling program.
What is the principal reason for passing arguments by reference ? In a function call, what all data items can be passed by reference ?
What are the three types of functions in Java?
Write a function that interchanges the value of two integers A and B without using any extra variable.