This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes return Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "return" Watch "return" New topic


Victor Lu

Joined: Jun 30, 2011
Posts: 6
What does

by itself do, when there is no return value specified? Thanks!
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63534

What are your thoughts on the matter?

[Asking smart questions] [About Bear] [Books by Bear]
ashwin bhawsar
Ranch Hand

Joined: Mar 16, 2011
Posts: 62

i think only 'return' without any values means it does not returns anything.
You can try out this piece of code:
Ogeh Ikem
Ranch Hand

Joined: May 13, 2002
Posts: 180
return means return to the calling method. If your method is a not a void method, it must return some data to the calling method.
I agree. Here's the link:
subject: return
It's not a secret anymore!