Angus Ferguson wrote:Using RETURN is useful when you want to retrieve and use the output of the method which is returning the value in a wider scope. For example, if you write a method calculateSum() and it returns the value 5 you could use that value 5 together with another methods like multiply() in order to orchestrate them and solve a bigger problem.
let's take example
ImDinesh Sharma wrote:I only know a tiny thing about this which is this
When we create a method, it provides the option to return some data in many forms such as int, boolean, string etc.
Where it returns
Why and where its useful to use this RETURN statement in method
Please could you explain this with simplest and easy way
So what you mean is We can solve a bigger problem using two methods with a single return type right
Angus Ferguson wrote:
It can get much more elaborated and it offers the posibility to reduce duplicated code improving readibility, scalability and modularity.
Be sure that your reply isn't within the quote tags. I've fixed it for you this time. Use the Preview button before the Submit button to be sure your post displays the way you want it to.