Java toString() method

toString() method of the Object class is used to provide a string representation of an object. When an object is passed in the print() method as an argument then the compiler internally calls the toString() method on the object. It returns object representation as classname@hexadecimal representation of the hash code of the object. class Student{ … Read more