0

What is difference between output and return type

2nd Apr 2020, 10:28 AM
Rajesh Deshbandhu
Rajesh Deshbandhu - avatar
2 Answers
+ 3
Output is something printed on the device(usually is screen). Return type is what type a function returns.(int, double or more)
2nd Apr 2020, 10:59 AM
你知道規則,我也是
你知道規則,我也是 - avatar
0
For example, say you have the following method: public int myMethod() { System.out.print("Hello") ; return 7 ; } You are printing to the console the String "Hello", but are returning the integer value 7 (usually so you can use it later). Hope this helps!
2nd Apr 2020, 12:15 PM
Mario M G
Mario M G - avatar