struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zhang, Larry \(L.\)" <lzhan...@ford.com>
Subject A try catch and return question
Date Mon, 01 Oct 2007 20:01:23 GMT
I have a method having the following structure:

public Object myMethod() {
	try {
	// some code
	return theReturnedObject,
	}catch{
         // some code
	}
	finally {
	 // some code
	}
}
 
Please let me know if the following version of code better than the
above?
public Object myMethod() {
	try {
	// some code
	
	}catch{
         // some code
	}
	finally {
	 // some code
	}

	return theReturnedObject,
}

The only difference is that the bottom one put the return down to the
bottom of the method and take the return out of the try. Please let me
know.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message