+ 1

void means 'no return value' then is that different with a method 'println()' ?? I don't understand the difference between return value and println()...!

1st Mar 2016, 9:35 AM
sooare
sooare - avatar
6 Réponses
+ 2
If I understood right, 1) "return" is just like assignment... a value .. to method... 2) But "println" is "print it" command.
10th Mar 2016, 9:34 AM
Zakir Şıxlı
Zakir Şıxlı - avatar
+ 1
If I'm can remember, to return a value means to bring back a value after you have run the method, while Print just means that it should print the value of something(be it a String, int, char, double, boolean, etc.) ont the screen/output screen.
1st Jul 2016, 5:08 PM
Chomba Chinambu
Chomba Chinambu - avatar
+ 1
println is a predefined method in Java which returns the value you pass as parameter.. while when you make your own function and Mark it void it means that function on call won't return any value to be further used
7th Aug 2016, 10:09 PM
Sachet Saxena
Sachet Saxena - avatar
+ 1
The main difference between print() and return is that print() is a predefined method of built-in class System where return is a statement used in a method. print() method prints the double quotes statement as it is on the screen but return statement returns the value of a variable after the execution of a method.
19th Aug 2016, 12:17 PM
Vansh Arora
Vansh Arora - avatar
0
println() is a method to print something. the method is not returning a value, its just printing the value on the screen / console!
7th May 2016, 3:24 PM
Ateeb
Ateeb - avatar
0
perfect bto
6th Jul 2016, 7:07 PM
CyberTronix
CyberTronix - avatar