🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.lang.java
Article #19087

Re: һ�����String�Ƚ��ٶȵķ���

#19087
From: ������
Date: Sat, 10 Jan 2004 08:17
18 lines
1945 bytes
�������Ҳ��if (strA.intern() == strB.intern()) ��
�� �� reoal (�ұ���������ѧ��18�����) �Ĵ������ᵽ: ��
: ʹ��intern()����equal()���бȽϡ�
: ���磺if(strA==strB.intern())
: ��sun�Լ������java������Ч�ʵ�ppt�Ͽ����ģ�ֻ�и�����û�н���
: �ҵ����������ģ�
:     ��Ϊ����intern()��ʱ��str�����Ǻ�pool�еıȽϣ�Ȼ�󷵻�һ��ÿ���ַ�Ψ
: һ��reference��
:     ����strA=new String("Hello");strB=new String("Hello");��ʱstrA��strB�ĵ�ַ
: ֵ�Dz�һ��ģ���strB.intern()��strA.intern()��ֵȷ��һ��ģ�������������֮��
: �Ƚϵ�Ч�ʡ�
: >>  .................<����ʡ��>............


--
 ���� ��Ĭ ���� ��� �ڼ� ���� �Ͽ� ���� ���� ��� �侲 ���

�� ��Դ:��Ʈ��ˮ�Ƽ� freecity.cnzju.net��[FROM: 10.214.2.98]
Technical Details
Message-ID: <4ACfLA$9yJ@freecity.cnzju.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!elnk-pas-nf1!elnk-nf2-pas!newsfeed.earthlink.net!sjc70.webusenet.com!news.webusenet.com!maily.cic.tsinghua.edu.cn!news.ccie.net.cn!Freecity

Show Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB
X-Google-Thread: f6cb0,5bd5248b5bc616b6
X-Google-Attributes: gidf6cb0,public
X-Google-ArrivalTime: 2004-01-10 00:20:26 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!elnk-pas-nf1!elnk-nf2-pas!newsfeed.earthlink.net!sjc70.webusenet.com!news.webusenet.com!maily.cic.tsinghua.edu.cn!news.ccie.net.cn!Freecity
From: windprayer.bbs@freecity.cnzju.net (������)
Newsgroups: cn.bbs.comp.lang.java
Subject: Re: һ�����String�Ƚ��ٶȵķ���
Date: 10 Jan 2004 08:17:22 GMT
Organization: Ʈ��ˮ�Ƽ�
Message-ID: <4ACfLA$9yJ@freecity.cnzju.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 8bit
X-Filename: Java/M.1073722618.A