gogoWebsite

What are the classes in Java that rewrite equals and toString methods

Updated to 18 days ago

String, Date, File, wrapper classes, etc. all rewrite the equals() method in the Object class. After rewriting, it is not about whether the two referenced addresses are the same, but about whether the "entity content" of the two objects is the same.

String, Date, File, wrapper classes, etc. all rewrite the toString() method in the Object class. Make the "entity content" information be returned when the object's toString() is called