What is the toString() method?
Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.
What is the toString() method?
Rating:
The toString() method returns a String object that gives a description of the object on which the method is called. The default implementation of the toString() method is in the Object class with the following signature:
Most of the classes override the toString() method with more informative versions. The overridden versions of the toString() method allow other classes to generate a description specifically for the types of objects that they create.
Rating:
Was this information helpful?
Other articles
- What are reference variables?
- What is the toHexString() method of the Double class?
- What are static methods?
- What is the printf() method?
- What is the Pattern class?