Return Value
noun
say it: “rih-TURN VAL-yoo” /rɪˈtɜrn ˈvælju/
The result a method sends back to the code that called it, using the return keyword.
What is Return Value in Java?
Return Value — The result a method sends back to its caller.
class OrderCalculator {
int total(int price, int quantity) {
return price * quantity;
}
}
In a sentence
- “The return value of calculateTax is the tax amount, which I add to the total.”
Level: Apprentice · More Java terms at this level
Updated