This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

return missing statement

 
murali kante
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the following snippet gives me a compile time error......saying missing return statement. where I am doing mistake....
public RegistryService getRegistryService(){
try{
registryService = jaxrConnection.getRegistryService();
return registryService;
}catch(Exception exception){
System.out.println"RegistryClientImpl : :"+exception);
}
}
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you don't have a return statement in your catch block, you have the possibility of not reaching a return statement, hence the error. You can either put a return statement in the catch block, or take the return out of the try block and stick it after the whole try/catch stuff.
Jason
[This message has been edited by jason adam (edited December 09, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic