Use of toString() method

When we print an object, internally the toString() method is called internally. toString() namaste print the hash code of the object. So if you want to print your own message instead of hashcode, just override toString() method and give your own implementation. 

Comments

Popular posts from this blog

Git Commands With Output Log

Java Interview Preparation (conceptual)

Java 8 Function Interface