CodesJava

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



Copyright © 2018 CodesJava DMCA.com Protection Status SiteMap