File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes return missing statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "return missing statement" Watch "return missing statement" New topic
Author

return missing statement

murali kante
Greenhorn

Joined: Nov 09, 2001
Posts: 9
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

Joined: May 08, 2001
Posts: 1932
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
 
subject: return missing statement