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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly