Learn Java Programming - Override .toString() Method Tutorial

preview_player
Показать описание
Throughout my tutorials I have discussed the toString() method on numerous occasions, so I thought it would be a good idea to give this popular method its own tutorial. Out of all 11 methods in the Object class, toString() is perhaps the easiest method to understand. Of course every class inherits the toString() method from the Object class and by default it returns a string value that represents the instance in a stringy sort of way. In order to understand precisely what the result of the default toString() method returns you should first watch my tutorials on Object .getClass() and Class Common Methods and my Overriding the .hashCode() method Tutorial.
Рекомендации по теме