when print the object , why it shows the hexadecimal representation of hash code followed by classnamse@ ?How java internally do this ?
simply I think standard toString() method is called.
I think that returning className+@+HEX of the hash code was an implementation choice since Java 1.0, a way to return a string without a meaning but at least with a semantic....
You can look at official Java documentation, there's explained how default toString() works.
S Majumder wrote:when print the object , why it shows the hexadecimal representation of hash code followed by classnamse@ ?
As Paul has said, Because that's what the writers of the JVM decided to do.
S Majumder wrote:How java internally do this ?
For more information:
S Majumder wrote:But I need to know how its actually work behind the back , when the method is not overridden , you can say its just my curiosity ..
Well, it looks like Gaurangkumar Khalasi has explained that. As for your curiosity, that's all very well, but if you also have the goal of being a Java programmer, then in my opinion you're wasting your time with all of these questions you are posting here.