Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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 Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "return missing statement" Watch "return missing statement" New topic

return missing statement

murali kante

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(){
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.
[This message has been edited by jason adam (edited December 09, 2001).]
I agree. Here's the link:
subject: return missing statement