Easy learning with example program codes

what is the purpose of tostring() method in java?

toString() method of Object class is used to provide string representation of an object.

When an object is passed in print() method as an argument then compiler internally call toString() method on the object. It returns object representation as classname@hexadecimal representation of hash code of the object.

Java interview questions on string handling

Sign Up/ Sign In
Ask a Question

Copyright © 2018 CodesJava Protection Status SiteMap Reference: Java Wiki