wood burning stoves*
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: 9291
    
  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: 9291
    
  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
 
Similar Threads
Cannot Open Excel file in Browser. + JSF + JSP + Bean
assignment
creating the triangle
Extra ; after Curly bracket close does't effect?
sequence confusion