What is the difference between return and print?



I'm just wondering why should I use the "return" while I make method.
What's the difference between return and print?

For example,

int spikeAge = spike.getAge();

is the correct code.

(Of course there is

public int getAge() {
return age;}

before those codes)

but why can't I just write


the consequence that I get would be the same, isn't it?

Replace this line with your code.


Printing is a one-off action that has no outcome or artifact. We print, it's done. End of story. Printing is also completely removed from the program's flow and its data.

Return has a continuation implied, but there is more. Just as a function takes an argument from a remote scope, the return value is sent back to the caller scope. It's an open channel to any scope from which it is called, and practically any object or expression can be passed back through it.