View Single Post
  #5 (permalink)  
Old 06-11-2009, 04:59 AM
kalees kalees is offline
Junior Member
 

Join Date: Sep 2009
Posts: 19
Thanks: 1
Thanked 0 Times in 0 Posts
kalees is on a distinguished road
Lightbulb Re: String Vs StringBuffer

Yes!

I am doing web application banking project,in struts frame work,
in my action class i am getting query result from different tables,so my QueryManager will return
the query result set,So my doubt is,

Java Code
                     private static final String QUERY1 = "select username,password,email from userstable";
                     private static final String QUERY2 = "select * from someothertable";
                     private static final String QUERY3 = "select * from userstable WHERE username=?";
if i create the query with different string,
will it be create more object then it takes more memory right?
So if i use StringBuffer then it will use the same memory right?.....

What is the benefit of creating different string obj for different query?.....
Reply With Quote