What is the purpose of toString() method in java ?
Page 1 of 1
What is the purpose of toString() method in java ?
The toString() method returns the string representation of any object. If you print any object, java compiler internally invokes the toString() method on the object. So overriding the toString() method, returns the desired output, it can be the state of an object etc. depends on your implementation.
Similar topics
» What is the purpose of finalize() method?
» Can subclass overriding method declare an exception if parent class method doesn't throw an exception ?
» What is the purpose of Synchronized block?
» What is the purpose of the Runtime class?
» What is the purpose of the System class?
» Can subclass overriding method declare an exception if parent class method doesn't throw an exception ?
» What is the purpose of Synchronized block?
» What is the purpose of the Runtime class?
» What is the purpose of the System class?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum