Return
If the only thing you could do with methods was to call them, they would have limited uses.
This is why methods can also "return" results to the code that calls them.
int plusOne(int x) {
return x + 1;
}
If the only thing you could do with methods was to call them, they would have limited uses.
This is why methods can also "return" results to the code that calls them.
int plusOne(int x) {
return x + 1;
}