0
why must use return?
I dont understand why we must use return keyword.... I try use or not..the result is same can output a result
3 ответов
0
In functions that returns some values you must use this keyword. For example this function: public int func (int a, int b ){int c = a+b; return c} will return the value of int type and you can use this value in your code.
0
while using datatype in method like public int(datatype) add() we should use return keyword
otherwise use void as a data type to avoid return keyword
0
When you use return, the function returns(sends) a value to the other method where it was called. It does not print whereas if you use system. out.print it will print and your main method will receive no value