File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes missing return statement 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 "missing return statement" Watch "missing return statement" New topic

missing return statement

Tripti Ag
Ranch Hand

Joined: Jul 03, 2009
Posts: 37
Dear all,
Below is a very simple program in Java. When I compile this program, I get error message - "missing return statement". Please suggest me why I am getting this error?

[Added code tags - see UseCodeTags for details]

Stuart A. Burkett
Ranch Hand

Joined: May 30, 2012
Posts: 679
Java is case sensitive. You've declared your method to return a Void.
Tripti Ag
Ranch Hand

Joined: Jul 03, 2009
Posts: 37
Thank you very much.
It is sorta covered in the JavaRanch Style Guide.
subject: missing return statement
It's not a secret anymore!