Core Java Interview Questions and Answers 21. What is the use of toString function? The toString function gets automatically inherited in all java classes from the Object class. We can override the toString function. Whenever we print an object of a class, by default the toString function of the class gets called. So if we want to give a customizable output when … [Read more...] about Important Core Java Interview Questions and Answers in 2023