• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

return missing statement

 
murali kante
Greenhorn
Posts: 9
  • 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
  • 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).]
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic