Hi:

the two ways are ok!!! 

but the second one is rigth use more memory.

----- Original Message ----- 
From: "Jacob Nikom" <[EMAIL PROTECTED]>
To: "Java-Linux listserver" <[EMAIL PROTECTED]>
Sent: Thursday, September 07, 2000 5:26 PM
Subject: Who is right?


> Hi,
> 
> This is not really Java-Linux, but more like Java question.
> May be it is different for Java Linux implementation, that is
> why I decided to ask.
> 
> My friend and I recently tried to figure out which String
> implementation is more efficient and correct:
> 
> String a = "bbbbbb"
> 
> or
> 
> String a = new String("bbbbbb");
> 
> He said that the second one is a copy constructor which is less
> efficient. It uses more memory and requires to copy the array
> from one place to another. I said that they are the same and it is
> simply different syntax. Who is right?
> 
>  Thank you,
> 
>  Jacob Nikom
> 
> 
> 
> 
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to