0
What's the basic difference between the 'return' and 'System.out.println' keywords when outputting something on the screen?
3 Respostas
+ 6
+ 1
return its a keyword that "return" (really?) a value from a function/method and output NOTHING... Its used at example like a squareRoot method must return the square root of parameter passed to it... System.out.prinln its an method that print parameter value to standard output (console usually)
+ 1
Imagine an ATM. println is like showing your balance, information is displayed but no value is given. return is like withdrawing cash, you actually get something out of the operation