O Aristides esta correto. Veja o que diz a especificacao da linguagem em 
http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#101083

"Literal strings within the same class (�8) in the same package (�7)
represent references to the same String object (�4.3.1). 

Literal strings within different classes in the same package represent
references to the same String object.

Literal strings within different classes in different packages likewise
represent references to the same String object. 

Strings computed by constant expressions (�15.28) are computed at
compile time and then treated as if they were literals. 

Strings computed at run time are newly created and therefore distinct. 

The result of explicitly interning a computed string is the same string
as any pre-existing literal string with the same contents."


No link acima tem um exemplo desses casos.



[EMAIL PROTECTED] wrote:
> 
> Aristides, acho que houve um engano vc alegando que tanto a String texto
> quanto a texto2 apontam para o mesmo endere�o de m�moria, verifique que s�o
> objetos diferentes!
> 
>     --------------------------- LISTA SOUJAVA ---------------------------
>     http://www.soujava.org.br  -  Sociedade de Usu�rios Java da Sucesu-SP
>     [d�vidas mais comuns: http://www.soujava.org.br/faq.htm]
>     [para sair da lista: http://www.soujava.org.br/forum/cadastrados.htm]
>     [regras da lista: http://www.soujava.org.br/regras.htm]
>     ---------------------------------------------------------------------

--
Eduardo Issao Ito <[EMAIL PROTECTED]>
Integration Technologies Ltda. <http://www.integrationtech.com.br>
Rua Marina Saddi Haidar, 176
04650-050 - Sao Paulo - SP - Brasil
Phone: +55 11 5524-8022  Fax: +55 11 5524-0408

    --------------------------- LISTA SOUJAVA ---------------------------
    http://www.soujava.org.br  -  Sociedade de Usu�rios Java da Sucesu-SP
    [d�vidas mais comuns: http://www.soujava.org.br/faq.htm]
    [para sair da lista: http://www.soujava.org.br/forum/cadastrados.htm]
    [regras da lista: http://www.soujava.org.br/regras.htm]
    ---------------------------------------------------------------------

Responder a