This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Output of a simple code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Output of a simple code" Watch "Output of a simple code" New topic
Author

Output of a simple code

Douglas Boff Nandi
Ranch Hand

Joined: Feb 25, 2008
Posts: 34


Why the output of this code finish with 19821f? Thank you for all.
armando fonseca
Ranch Hand

Joined: Apr 03, 2009
Posts: 49
because it is returning the memory address of the array returned by the method .values().


scjp6-90%
Douglas Boff Nandi
Ranch Hand

Joined: Feb 25, 2008
Posts: 34
Thank you. Now its clear to me
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

Well the output exactly looks something like this

[LEnumTest$Animals;@19821f


And 19821f is not the memory address of the array. It is the value returned by the toString method of Enum[] class. So basically 12821f is the hash code for the enum array...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

Well the output exactly looks something like this

[LEnumTest$Animals;@19821f


And 19821f is not the memory address of the array. It is the value returned by the toString method of Enum[] class. So basically 12821f is the hash code for the enum array...

[Sorry, I don't know if it is my fault or it happens when you do a quick reply ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Output of a simple code