RSS Forums RSS
Please support our Java advertiser: Lunarpages Java Web Hosting

Missing return Statement

Join Date: May 2007
Location: USA
Posts: 3,340
Reputation: Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold 
Rep Power: 16
Solved Threads: 332
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Nearly a Senior Poster

Re: Missing return Statement

  #2  
Nov 5th, 2007
Because all of your return statements are in conditionals (the "if"s), there is not a guaranteed return path. Instead of putting the returns in the if clauses, make a variable to hold the calculation and make a single return of that value at the end of the method.
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:03 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC