String concatenation 2005-08-31 - By SUBSCRIBE EJB-INTEREST anonymous
Back Hi, I have a question in string concatenation.
I have the below code.
StringBuffer a = new StringBuffer(); a.append("Name=" + userVo.getName()); a.append("Id = " + userVo.getId()); a.append("Sno="+userVo.getSno()); a.append("Sno1="+userVo.getSno1());
Instead of using + to append strings, if I concatenate strings as below, will it be faster than the above one? Is not for the below , only few strings get used.So, is the below one better than the above?
StringBuffer a = new StringBuffer(); a.append("Name=").append(userVo.getName())); a.append("Id = ").append(userVo.getId())); a.append("Sno=").append(userVo.getSno())); a.append("Sno1=").append(userVo.getSno1()));
Thanks in advance.
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
|
|