is it better to instantiate a string with the value of an http request parameter or to read the parameter from the request every time in nested if conditions?
For example :
if( request.getParameter( "pageMove" ) != null ){
if( request.getParameter( "pageMove" ).equals( "N" )){
;;
}
}
vs.
String pageMove = request.getParameter( "pageMove" );
if( pageMove ) != null) {
if( pageMove ).equals( "N" ) ){
;;
}
}
Which is more efficient in terms of performance and memory management?
Thanks