Extending class Object 01 Flashcards
1
Q
• Can you explain the purpose of the toString() method and its conventional formation?
A
toString() method returns the string representation of the object.
2
Q
Can you explain the purpose of the equals() method?
A
Equals() is used to compare the string to a specified object. result is true is argument is not null and string object represents the same sequence of characters as this object.