🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #1074

Re: about a socket programm

#1074
From: John McGrath TeamB
Date: Mon, 03 Jun 2002 11:24
29 lines
2061 bytes
On Mon, 3 Jun 2002 10:35:25 +0200, Zhilei Ma wrote:

> And are these Object Identifiers useful to programmers in
> the network programming? When yes, is there any exsamples?

Not particularly, except perhaps for debugging.

The implementation of the toString() in the Object class prints the 
class name, the character "@", and the hash code for the object.  The 
Object implementation of hashCode() returns the "object identifier", or 
the internal address for the object in the JVM.

Returning an "internal address" is not required by any specification, 
but that is how the Sun JVMs implement it.  The docs do suggest that it 
should be a unique value, but that is not required either.

Note that for classes that override hashCode() and equals() properly, 
the default toString() value will not especially be unique.  Objects 
that are equal() will have the same hashCode(), so you will get the 
same toString() value for distinct but equal() objects.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <MPG.176500e857209f698b690@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!peer1-sjc1.usenetserver.com!usenetserver.com!news.tele.dk!small.news.tele.dk!213.73.101.75!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3cf7483a$1_2@dnews> <3cf77014_2@dnews> <3cfb2a4e$1_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,bd515b267b76cac1
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2002-06-03 04:39:44 PST
From: John McGrath  [TeamB] <ng-b@JPMcGrath.net>
Newsgroups: borland.public.jbuilder.java.api
Subject: Re: about a socket programm
Date: Mon, 3 Jun 2002 07:24:05 -0400
Message-ID: <MPG.176500e857209f698b690@newsgroups.borland.com>
References: <3cf7483a$1_2@dnews> <3cf77014_2@dnews> <3cfb2a4e$1_2@dnews>
X-Newsreader: MicroPlanet Gravity v2.60
NNTP-Posting-Host: 209.92.40.60
X-Trace: dnews 1023103444 209.92.40.60 (3 Jun 2002 04:24:04 -0700)
Lines: 29
X-Authenticated-User: jpmcgrath
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!peer1-sjc1.usenetserver.com!usenetserver.com!news.tele.dk!small.news.tele.dk!213.73.101.75!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!dnews