: [java programming] Re: String vs StringBuffer
I remeber there are three classes for
String,String,StringBuffer,StringBuilder.
String is a final class, can't change its address and its size.When we
concat two string, There will create 3 strings.
StringBuffer is also a final clas
I remeber there are three classes for
String,String,StringBuffer,StringBuilder.
String is a final class, can't change its address and its size.When we
concat two string, There will create 3 strings.
StringBuffer is also a final class,But its size is not static,So we can
insert or append substring
On Aug 12, 11:26 am, hefaeche wrote:
> How can I see this? Thanks
If you use Netbeans 6.7.1 (it should be more or less the same for
other versions of Netbeans):
1 - put a break mark before the lines String str = ... and
str.concat...
2 - in Preferences Java Debugger, make it so that only Do not
Perhaps the question should be: What does it mean that String is not
mutable? On the other hand, if StringBuffer is better, why not always
use StringBuffer?
On 12 ago, 11:26, hefaeche wrote:
> How can I see this? Thanks
>
> On 11 ago, 19:07, Márcio Souza wrote:
>
> > With String => You'll creat
StringBuffer it's final class too
On 11 ago, 17:53, "maa...@gmail.com" wrote:
> I always thought String was a final class, while StringBuffer wasn't.
>
> Cheers,
>
> -m
>
>
>
> On Tue, Aug 11, 2009 at 5:37 AM, hefaeche wrote:
>
> > What it's the difference? Which it's better?
>
> > String str =
In my example, ¿str not it's mutable?
On 11 ago, 20:11, Anand wrote:
> String is immutable . So whatever data stored in String var remain for
> temporary whereas
> StringBuffer stores data permanently. so Stringbuffer is better
>
> 2009/8/11 Márcio Souza
>
>
>
> > With String => You'll create
How can I see this? Thanks
On 11 ago, 19:07, Márcio Souza wrote:
> With String => You'll create 3 Strings.
> With StringBuilder => You'll create 1 String.
>
> vlw!
> You
>
> 2009/8/11 maa...@gmail.com
>
> > I always thought String was a final class, while StringBuffer wasn't.
>
> > Cheers,
>
>
String is immutable . So whatever data stored in String var remain for
temporary whereas
StringBuffer stores data permanently. so Stringbuffer is better
2009/8/11 Márcio Souza
> With String => You'll create 3 Strings.
> With StringBuilder => You'll create 1 String.
>
> vlw!
> You
>
> 2009/8/11
With String => You'll create 3 Strings.
With StringBuilder => You'll create 1 String.
vlw!
You
2009/8/11 maa...@gmail.com
> I always thought String was a final class, while StringBuffer wasn't.
>
> Cheers,
>
> -m
>
> On Tue, Aug 11, 2009 at 5:37 AM, hefaeche wrote:
>
>>
>> What it's the differ
I always thought String was a final class, while StringBuffer wasn't.
Cheers,
-m
On Tue, Aug 11, 2009 at 5:37 AM, hefaeche wrote:
>
> What it's the difference? Which it's better?
>
> String str = new String( "Hola" );
> str = str.concat(" Mundo" );
> System.out.println( str );
>
> vs
>
> Strin
10 matches
Mail list logo