Advertisements
Advertisements
प्रश्न
In what situation does a method return a value?
संक्षेप में उत्तर
उत्तर
When a method is defined to deliver an output to its caller program, it returns a value.
Example:
int factorial(int x)
{
}
According to the method specification above, this method returns an integer value. To return an integer value, include a return statement at the end of the method, as specified by the return type.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?