How "return()" concept is work in java coding? I m confused about it | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

How "return()" concept is work in java coding? I m confused about it

2nd Nov 2016, 4:33 PM
Shraddha Telgote
Shraddha Telgote - avatar
2 Respuestas
+ 1
lets say you have a method called sum: public int sum(int a, b) { return a+b; } This will basically say: we are going to add a to b and using the method you like: int sumnrs = sum(5, 3); if you print this out you will get 8 because you are basically doing this: int sumnrs = 5 + 3;
2nd Nov 2016, 8:34 PM
somestuffontheinternet
somestuffontheinternet - avatar
0
thanks lucas
3rd Jan 2017, 3:49 PM
Shraddha Telgote
Shraddha Telgote - avatar