This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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

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: 63211

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.
I agree. Here's the link:
subject: return
It's not a secret anymore!