Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

missing return statement

 
Tripti Ag
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 679
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java is case sensitive. You've declared your method to return a Void.
 
Tripti Ag
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic