Java return statement problem.
Hello there :)
I have a question about the return statement... I'm not getting anything when I run my code. I should get answers like Winter, Fall, Spring, Summer but my return is not working?
Thanks for the help. :)
Here is my code:
You aren't seeing anything because you aren't doing anything with the returned value. The return statement just returns the value of the defined type to the caller of that method. In any language such as Java/C/C++ that supports a "return" statement, in order to use the returned value you would need to either "assign" that return value to a variable and then use it or simply make that method call where you need the value.
variable = methodCall();
|All times are GMT +1. The time now is 01:00 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.