There is no relationship between returning a value and printing a value. See post #11
Type: Posts; User: Norm
There is no relationship between returning a value and printing a value. See post #11
One simple thing a return statement allows you to do in a program is to put a method call on the right hand side of an assignment statement.
variable = aMethod(args); // here the method...
Why is that? Did it work ok?
For static methods, you don't need to create an object. You could reference your static methods this way:
int y = JavaObject.factorial(5) + JavaObject.factorial(3);
...
Try it and see what happens? Be sure to report back what happens.