Every class in Java extends Object, either directly or through a chain of parents. If you write class Dog { } without extends, Java treats it as class Dog extends Object.
This means every object you create has methods from Object built in:
toString()returns a string representation of the objectequals(Object o)checks if two objects are logically equalhashCode()returns an integer hash for use in hash-based collectionsgetClass()returns the runtime class of the object
The default toString() returns something like Dog@1a2b3c. The default equals() checks reference equality (same object in memory), not whether two objects have the same field values. You'll almost always want to override both.