+ 1
What is the difference between return statement and print statement
Return vs System.out.print() What makes it different from.each other
4 Respostas
+ 6
The print statment prints somthing to console window so you can see it like "hello world",
The return statment returns somthing back to were the method was called basicly you create a method that does somthing when you pass in some values, the method will do somthing with these and return the outcome back to were the method was called.
+ 2
In a void method you can also use just return:
You don't return a value but you jump back to the code where the method was called.
Using "return" in your main method: end program
+ 1
Will the return value be printed.