This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara 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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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: 61103

What are your thoughts on the matter?

[Asking smart questions] [Bear's FrontMan] [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.
It is sorta covered in the JavaRanch Style Guide.
subject: return