tostring method java

toString() Java

Generally, a programmer knows toString() method is used to convert an object into string form. But toString() has big story to know. Some known facts of toString() method 1. toString() method is defined in java.lang.Object class. 2. As it is defined in Object class, every class of Java inherits this…